Create a neural network to recognize your face and clearly discern it from other faces and objects!
This notebook was executed and implemented in Windows 10 operating system. Due to the corona pandemie I was not able to test the code on a Linux operating system at university.
The scope of the project work of the lecture "Autonomous Systems - Deep Learning" is to implement software to recognize my own face and clearly discern it from other human faces and objects.
This task must be addressed and solved using deep learning with transfer learning and the framework that will be used is tensorflow as the backend and the High-level API Keras in the python programming language.
The problem in deep learning and facial recognition is that we do not "hardcode" mathematical rules and alghotihms to recognize the classes. Deep Learning learns from experience, that means looking at labeled training data, making predictions on it, compare these predictions with the ground truth label and then optimize a error loss function based on the predictions. Optimize the error loss function means to search for the global minimum.
To solve this task, big amount of data is needed in order to secure a good performance of the deep learning model. Based on the training data on which a deep learning model is trained on, the model should generalize from that training data to unseen data, so that the model can make predictions on this new and unseen data. This is very important because in real life applications you need to make predictions on new data that the model was not trained on! Real life applications can be to unlock the smartphone screen when a specific face looks onto the screen or to get access to rooms in companies per face recognition.
In order to train the model properly and provide good performance, the quality of the data is from very high importance. A dataset will be presented in this project where 40% of the data is created by myself and the other 60% of the data was downloaded from research and educational datasets, provided in the internet from different sources. The dataset which is uploaded with this notebook contains prepared data on which training can be done. The deep learning network will be created based on the gained knowledge during the lecture from Prof. Dr.-Ing. Stache.
First the used dataset is described and the data preparation is done, then the neural network is trained based this prepared dataset and in the last steps an evaluation of the resulting model and a discussion of the results is presented.
Before the discussion of the results, a second model, which is designed to work efficiently on mobile devices, is also trained and shortly evaluated.
First all the needed modules and packages are imported to provide all the functionality und functions we need to solve the task. For example, many keras functionalities are imported in order to set up the deep learning model structure and to train it. The os module is imported to handle relative and absolute paths safely on different operating systems and provide executability of the implementation. Other modules like PIL are imported to perform image manipulations, numpy for scientific calculations and matplotlib to plot graphs and results.
# Import all the relevant packages used in this project
from tensorflow.keras.layers import Dense, Flatten, Dropout
from tensorflow.keras.models import Model
from tensorflow.keras.applications.inception_resnet_v2 import InceptionResNetV2
from tensorflow.keras.applications.inception_resnet_v2 import preprocess_input
from tensorflow.keras.preprocessing import image
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping
from tensorflow.keras import backend as K
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
import os
import itertools
from sklearn.model_selection import train_test_split
from PIL import Image
In a next step, it is checked wether a GPU (Graphics Processing Unit) is available to speed up the training process. With a GPU the network could be trained a lot faster, which is more comfortable due to fine tuning the hyperparameters based on the training and validation dataset. A GPU was used to fine tune the model at a friend's computer (Nvidia GeForce GTX 1080 Ti) since I don't own a GPU.
# Check if GPU is available
print('GPU available: ', tf.test.is_gpu_available())
print('TF Session: ', tf.keras.backend.clear_session())
GPU available: True TF Session: None
Getting and collecting data is the most crucial and important part when it comes to make predictions with a deep neural network. Often it is a very underestimated and very time consuming activity to get, create and prepare the data for data science projects.
Examples of the dataset will be shown later in this notebook.
For the classification task, three classes were used. In the following the used dataset, sources and classes are described:
One of the tasks of this project is to collect and create own data. To get the data of my own face, datasamples of the category "Markus" are created by myself.
Images were made with an iPhone 8 with its 7 Megapixel front camera and saved as JPEG file format. Selfies were made from slightly varrying distances, but it was importand to try to match the positions of the faces of other humans in the dataset "Others", so that the relevant features from the faces can be learnt and not for example the camera position or the background as main feature to make predictions on.
The images are quadratic and the whole face including hair and a little bit of the t-shiert is seen on the foto. A little background and clothes of myself are seen on the images. Images were made with different t-shierts/pullovers and in front of different backgrounds.
Sometimes I made a foto series of 50 fotos in a row in a few seconds with the foto-series function of the iPhone, slightly varying the angle or distance of the camera with my arm while taking the images.
Examples of the images are shown later in this notebook.
The photos of random human faces were downloaded from the data science related website kaggle, which are offering the images for free and with non commercial research and educational purposes only.
The dataset is the Flickr-Faces-HQ Dataset (FFHQ) downloaded from https://www.kaggle.com/arnaud58/flickrfaceshq-dataset-ffhq/data
This dataset consists of 52.000 PNG images at a quadratic resolution of 512Ć512 and contains different groups of people due to age, ethnicity, nationality, hairstyle, clothes, facial expression and image background. The original source of the images is Flickr and were web scraped from there. The original images were automatically aligned and cropped by the creators using dlib.
The dataset is originally created from:
A Style-Based Generator Architecture for Generative Adversarial Networks
Tero Karras (NVIDIA), Samuli Laine (NVIDIA), Timo Aila (NVIDIA)
https://arxiv.org/abs/1812.04948
A dataset of objects was downloaded containing objects like ships, cars, aircrafts, bags, pencils, machines etc.
It contains 1852 different objects and has over 26.000 images.
This dataset is the "THINGS object concept and object image database" downloaded from: https://osf.io/jum2f/
The dataset is created by:
THINGS: A database of 1,854 object concepts and more than 26,000 naturalistic object images.
Martin N. Hebart, Adam H. Dickter, Alexis Kidder, Wan Y. Kwok, Anna Corriveau, Caitlin Van Wicklin & Chris I. Baker
Laboratory of Brain and Cognition, National Institute of Mental Health, National Institutes of Health, Bethesda MD, USA
Hint: Examples of the preprocessed data are shown in Chapter "4. Examples of the data" and more specific information of the (preprocessed) image dataset is showed in Chapter "3. Data Preparation".
First the folder structure of the processed and prepared training, validation and test images of the classes are checked wether they are empty or containing processed data. If one folder is empty the data preparation of that specific class is done and if processed data is available for that specific class in every training, validation and test folder, nothing is done.
When data preparation is executed e.g. for the class "Markus", then all images of the class "Markus" in training, validation and test folders are deleted.
The raw image fotos (jpeg or png files) are then cropped to have the same view of the faces in both datasets "Markus" and "Others" and then they are resized to match the image size of the neural network (240x240) and to decrease the memory size of the images in order to upload them into ILIAS.
Splitting up the processed data in Training, Validation and Testing datasets and saving them in the corresponding folder structure is also done in the preparation process.
The target file format of the preprocessed data is JPEG file format and is uploaded in ILIAS along with this jupyter notebook.
The folders which contains the processed training, validation and test dataset is set up in the following folder structure:
This specific folder structure is important so that we can feed the data to our model during training process with Keras.
# Predefine values for data preparation
IMG_SIZE = (240, 240) # Target Image size to resize the raw images
quality_val = 100 # quality value to save the file as .jpg
# Define the paths of training, validation and test data of "Markus"
train_path_markus = './Data/Dataset/Training/Markus'
val_path_markus = './Data/Dataset/Validation/Markus'
test_path_markus = './Data/Dataset/Test/Markus'
# If one folder contains no images, then start preparation process
if len(os.listdir(train_path_markus))==0 or len(os.listdir(val_path_markus))==0 or len(os.listdir(test_path_markus))==0:
print("Execution of Data Preparation startetd!")
path_markus_raw = os.path.join(os.getcwd(), r'./Raw_Data_Markus') # path to raw images of my face
data = os.listdir(path_markus_raw) # List containing all filenames of the raw images of class "Markus"
# Split up the list of filenames in list of filenames of train, validation & test data
train, val = train_test_split(data, test_size=0.15, shuffle=True)
train, test = train_test_split(train, test_size=0.1, shuffle=True)
# Delete all remaining files in the train, validation and test folder of "Markus"
for x in [train_path_markus, val_path_markus, test_path_markus]:
filelist = [f for f in os.listdir(x)]
for f in filelist:
os.remove(os.path.join(x, f))
x = 300 # Quadratic crop size
# Loop through splited up training, validation and test image files and paths to save them
for datanames, save_path in [[train, train_path_markus], [val, val_path_markus], [test, test_path_markus]]:
# Loop through every image filename in corresponding train, val or test folder
for filename in datanames:
# Only process .jpg image files
if filename.endswith('.JPG') or filename.endswith('.jpg'):
# Open an image as an array
img = Image.open(os.path.join(path_markus_raw, filename))
# Get image width and height
w, h = img.size
# Check if image is quadratic
if w == h:
# Specify box coordinates to crop image
left, upper, right, lower = x, x, w-x, h-x
# Crop and resize image
img = img.crop((left, upper, right, lower))
img = img.resize(IMG_SIZE, Image.ANTIALIAS)
# Rotate image 90 deg because PIL considers Metadata of iPhone camera to rotate image
img = img.rotate(-90)
img.save(os.path.join(save_path, filename), 'JPEG', quality=quality_val)
# If image is not quadratic do following
else:
if w < h:
# Specify box coordinates to crop image
left, upper, right, lower = 0, (h-w)//2, w, h - (h-w)//2
img = img.crop((left, upper, right, lower))
img = img.rotate(-90)
else:
left, upper, right, lower = (w-h)//2, 0, w - (w-h)//2, h
img = img.crop((left, upper, right, lower))
img = img.rotate(-90)
img = img.resize(IMG_SIZE, Image.ANTIALIAS)
img.save(os.path.join(save_path, filename), 'JPEG', quality=quality_val)
else:
print('File' ,filename, 'is no JPG format!')
else:
print("Data is already processed and prepared!")
Data is already processed and prepared!
# Define the paths of training, validation and test data of "Others"
train_path_others = './Data/Dataset/Training/Others'
val_path_others = './Data/Dataset/Validation/Others'
test_path_others = './Data/Dataset/Test/Others'
# If one folder contains no images, then start preparation process
if len(os.listdir(train_path_others))==0 or len(os.listdir(val_path_others))==0 or len(os.listdir(test_path_others))==0:
print("Execution of Data Preparation startetd!")
# Path to raw 512x512 FlickR images of other human faces
path_others_raw = os.path.join(os.getcwd(), './Raw_Data_Others')
# List with all filenames of the raw images of class "Others"
data = os.listdir(path_others_raw)
# Split up the list of filenames in list of filenames of train, validation & test data
train, val = train_test_split(data, test_size=0.15, shuffle=True)
train, test = train_test_split(train, test_size=0.1, shuffle=True)
# Delete all the existing files in the train, validation and test folder of "Others"
for x in [train_path_others, val_path_others, test_path_others]:
filelist = [f for f in os.listdir(x)]
for f in filelist:
os.remove(os.path.join(x, f))
x = 60 # quadratic crop size to crop the raw images before resizing
# Loop through splited up training, validation and test image files and paths to save them
for datanames, save_path in [[train, train_path_others], [val, val_path_others], [test, test_path_others]]:
# Loop through every image filename in corresponding train, val or test folder
for filename in datanames:
# Only process .png image files
if filename.endswith('.PNG') or filename.endswith('.png'):
# Open an image as array and get width and height
img = Image.open(os.path.join(path_others_raw, filename))
w, h = img.size # get image width and height
# Check if image is quadratic, it should be
if w == h:
# Specify box coordinates to crop image
left, upper, right, lower = x, x, w-x, h-x
# Crop and resize image
img = img.crop((left, upper, right, lower))
img = img.resize(IMG_SIZE, Image.ANTIALIAS)
# In order to save as .jpg file, the ending of the filename must be changed from .png to .jpg
filename = filename.replace('.png', '.JPG')
# Save processed image as .jpg file
img.save(os.path.join(save_path, filename), 'JPEG', quality=quality_val)
else:
print('File' ,filename, 'is not quadratic!')
else:
print('File' ,filename, 'is no PNG format!')
else:
print("Data is already processed and prepared!")
Data is already processed and prepared!
# Define the paths of training, validation and test data of "Objects"
train_path_objects = './Data/Dataset/Training/Objects'
val_path_objects = './Data/Dataset/Validation/Objects'
test_path_objects = './Data/Dataset/Test/Objects'
if len(os.listdir(train_path_objects))==0 or len(os.listdir(val_path_objects))==0 or len(os.listdir(test_path_objects))==0:
print("Execution of Data Preparation startetd!")
path_objects_raw = os.path.join(os.getcwd() ,'./Raw_Data_Objects')
filenames = os.listdir(path_objects_raw)
print(len(filenames), 'Raw Data Images for Class Objects')
train, val = train_test_split(filenames, test_size=0.15, shuffle=True)
train, test = train_test_split(train, test_size=0.1, shuffle=True)
for x in [train_path_objects, val_path_objects, test_path_objects]:
filelist = [f for f in os.listdir(x)]
for f in filelist:
os.remove(os.path.join(x, f))
for datanames, save_path in [[train, train_path_objects], [val, val_path_objects], [test, test_path_objects]]:
for filename in datanames:
if filename.endswith('.JPG') or filename.endswith('.jpg'):
img = Image.open(os.path.join(path_objects_raw, filename))
w, h = img.size
if w == h:
new_img = img.resize(IMG_SIZE, Image.ANTIALIAS)
new_img.save(os.path.join(save_path, filename), 'JPEG', quality=quality_val)
else:
print('File' ,filename, 'is not quadratic like expected!')
else:
print('File' ,filename, 'is no JPG format!')
else:
print("Data is already processed and prepared!")
Data is already processed and prepared!
The following chart contains information about the sample size of the dataset in absolute and relative numbers of image samples and information about the content of the dataset.
# All image data is resized to the following image size
IMAGE_SIZE = [240, 240]
# Training, validation and test data paths are defined with os module:
train_path = './Data/Dataset/Training'
validation_path = './Data/Dataset/Validation'
test_path = './Data/Dataset/Test'
class_names = ['/Markus', '/Others', '/Objects']
image_files = []
for clname in class_names:
image_files += os.listdir(train_path + clname)
validation_image_files = []
for clname in class_names:
validation_image_files += os.listdir(validation_path + clname)
test_image_files = []
for clname in class_names:
test_image_files += os.listdir(test_path + clname)
print('Number of Training Images: ', len(image_files))
print('Number of Validation Images: ', len(validation_image_files))
print('Number of Test Images: ', len(test_image_files))
print('\nNumber of Total Images: ', len(test_image_files)+len(validation_image_files)+len(image_files))
# How many classes are available due to the folder structure:
folders = glob(train_path + '/*')
print('\nNumber of classes: ', len(folders))
Number of Training Images: 3129 Number of Validation Images: 615 Number of Test Images: 349 Number of Total Images: 4093 Number of classes: 3
In the following section, examples of the preprocessed dataset from all classes are shown.
# Function to plot 4 (by default) randomly chosen images from a given path
def random_imageplot(path, num=4):
"""Plot randomn images from a given path."""
liste = os.listdir(path) # Create list of all filenames available in path
for _ in range(num): # Iterate num-times (default num=4)
img_path = np.random.choice(liste) # Pick a random imagename from liste
img = image.load_img(os.path.join(path,img_path)) # Load the random-chosen image
plt.imshow(img)
plt.title('Image Size: ' + str(img.size))
plt.xlabel('u [px]')
plt.ylabel('v [px]')
plt.show()
This is the data i have created on my own with a smartphone front camera (iPhone 8). Data is showed from all three training, validation and test dataset.
# Plot random chosen images of class "Markus" from the training dataset
random_imageplot(os.path.join(train_path, 'Markus'), 4)
# Plot random chosen images of class "Markus" from the validation dataset
random_imageplot(os.path.join(validation_path, 'Markus'), 4)
# Plot random chosen images of class "Markus" from the test dataset
random_imageplot(os.path.join(test_path, 'Markus'), 4)
This is the dataset from other human faces from the Flickr-Faces-HQ Dataset (FFHQ) downloaded from https://www.kaggle.com/arnaud58/flickrfaceshq-dataset-ffhq/data.'. Only random images from the training dataset are showed.
# Plot random chosen images of class "Others" from the training dataset
random_imageplot(os.path.join(train_path, 'Others'), 5)
"THINGS object concept and object image database" downloaded from: https://osf.io/jum2f/. Only random images from the training dataset are showed.
# Plot random chosen images of class "Objects" from the training dataset
random_imageplot(os.path.join(train_path, 'Objects'), 4)
Since transfer learning is used in this task, a already pretrained network will be used here. The following image from mathworks describes the pipeline of the Transfer learning process applied in this Notebook:
source of image: https://de.mathworks.com/help/deeplearning/ug/train-deep-learning-network-to-classify-new-images.html
First, the pretrained network is loaded and the top layers (fully connected layers), which are the classifying layers based on the extracted features from the layers before, are replaced by our own layers.
Then the network will be trained, but only the weights of our own defined fully-connected top layers are changed. The weights of the base model, which is extracting the features with Convolutional layers will not be trained.
In the next step, the accuracy, precision and recall of the resulting model will be evaluated based on the training, validation and test dataset.
In the last step the resulting model and its results are plotted and visualized. The results of the model, like accuracy of the validation dataset, can be used in a feedback loop back to the training process to finetune the hyperparameters.
For transfer learning, we need to load a pre-built and pre-trained deep neural network architecture. I decided to use the InceptionResNetV2 model. It was trained on the imagenet dataset, which weights are specifically loaded in this notebook. The input size is defined as the above chosen image size (240, 240) plus the three color channels for the RGB color space.
The top layers of the network are specifically not loaded on top of the model with include_top=False. This step is crucial for the transfer learning since we want to train the model only on those layers we are including by our own on top of the model output without top layers. The network should then be trained on how to classify my own three classes based on the feature extraction of the base model of the pretrained network.
In the following, the InceptionResNetV2 model is defined without top layers as the base_model.
On top of this base model, we can define layers over layers as we want!
The weights of the base model are set to be freezed, which means, they will not be trained during the training process! Only the weights of our custom defined top layers we set on top will be trained in the whole training process, learning to do the classification task.
# Import the InceptionResNetV2 deep neural network model without top layers and load weights based on imagenet
base_model = InceptionResNetV2(input_shape=IMAGE_SIZE + [3], weights='imagenet', include_top=False)
Generate a Keras Model, double check the final structure and compile it.
def create_model():
"""Set up the deep neural network based on Inception ResNetV2 model and return the created model"""
# Do not train pretrained base_model weights and freeze them
for layer in base_model.layers:
layer.trainable = False
# Flatten the output tensor of the base_model
x = Flatten()(base_model.output)
# Connect a Dense layer to the flattened output
prediction = Dense(len(folders),
activation='softmax')(x)
# Create a model object from inputs and outputs of the whole architecture
model = Model(inputs=base_model.input, outputs=prediction)
# Print the structure of the resulting deep learning model
print(model.summary())
# Define the cost and optimization method of the model to use in the training process
model.compile(
loss='categorical_crossentropy', # loss for categorical data
optimizer='rmsprop',
metrics=['accuracy'])
return model
# Instantiate our model object for the training, validation and testing process
model = create_model()
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 240, 240, 3) 0
__________________________________________________________________________________________________
conv2d (Conv2D) (None, 119, 119, 32) 864 input_1[0][0]
__________________________________________________________________________________________________
batch_normalization (BatchNorma (None, 119, 119, 32) 96 conv2d[0][0]
__________________________________________________________________________________________________
activation (Activation) (None, 119, 119, 32) 0 batch_normalization[0][0]
__________________________________________________________________________________________________
conv2d_1 (Conv2D) (None, 117, 117, 32) 9216 activation[0][0]
__________________________________________________________________________________________________
batch_normalization_1 (BatchNor (None, 117, 117, 32) 96 conv2d_1[0][0]
__________________________________________________________________________________________________
activation_1 (Activation) (None, 117, 117, 32) 0 batch_normalization_1[0][0]
__________________________________________________________________________________________________
conv2d_2 (Conv2D) (None, 117, 117, 64) 18432 activation_1[0][0]
__________________________________________________________________________________________________
batch_normalization_2 (BatchNor (None, 117, 117, 64) 192 conv2d_2[0][0]
__________________________________________________________________________________________________
activation_2 (Activation) (None, 117, 117, 64) 0 batch_normalization_2[0][0]
__________________________________________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 58, 58, 64) 0 activation_2[0][0]
__________________________________________________________________________________________________
conv2d_3 (Conv2D) (None, 58, 58, 80) 5120 max_pooling2d[0][0]
__________________________________________________________________________________________________
batch_normalization_3 (BatchNor (None, 58, 58, 80) 240 conv2d_3[0][0]
__________________________________________________________________________________________________
activation_3 (Activation) (None, 58, 58, 80) 0 batch_normalization_3[0][0]
__________________________________________________________________________________________________
conv2d_4 (Conv2D) (None, 56, 56, 192) 138240 activation_3[0][0]
__________________________________________________________________________________________________
batch_normalization_4 (BatchNor (None, 56, 56, 192) 576 conv2d_4[0][0]
__________________________________________________________________________________________________
activation_4 (Activation) (None, 56, 56, 192) 0 batch_normalization_4[0][0]
__________________________________________________________________________________________________
max_pooling2d_1 (MaxPooling2D) (None, 27, 27, 192) 0 activation_4[0][0]
__________________________________________________________________________________________________
conv2d_8 (Conv2D) (None, 27, 27, 64) 12288 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
batch_normalization_8 (BatchNor (None, 27, 27, 64) 192 conv2d_8[0][0]
__________________________________________________________________________________________________
activation_8 (Activation) (None, 27, 27, 64) 0 batch_normalization_8[0][0]
__________________________________________________________________________________________________
conv2d_6 (Conv2D) (None, 27, 27, 48) 9216 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
conv2d_9 (Conv2D) (None, 27, 27, 96) 55296 activation_8[0][0]
__________________________________________________________________________________________________
batch_normalization_6 (BatchNor (None, 27, 27, 48) 144 conv2d_6[0][0]
__________________________________________________________________________________________________
batch_normalization_9 (BatchNor (None, 27, 27, 96) 288 conv2d_9[0][0]
__________________________________________________________________________________________________
activation_6 (Activation) (None, 27, 27, 48) 0 batch_normalization_6[0][0]
__________________________________________________________________________________________________
activation_9 (Activation) (None, 27, 27, 96) 0 batch_normalization_9[0][0]
__________________________________________________________________________________________________
average_pooling2d (AveragePooli (None, 27, 27, 192) 0 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
conv2d_5 (Conv2D) (None, 27, 27, 96) 18432 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
conv2d_7 (Conv2D) (None, 27, 27, 64) 76800 activation_6[0][0]
__________________________________________________________________________________________________
conv2d_10 (Conv2D) (None, 27, 27, 96) 82944 activation_9[0][0]
__________________________________________________________________________________________________
conv2d_11 (Conv2D) (None, 27, 27, 64) 12288 average_pooling2d[0][0]
__________________________________________________________________________________________________
batch_normalization_5 (BatchNor (None, 27, 27, 96) 288 conv2d_5[0][0]
__________________________________________________________________________________________________
batch_normalization_7 (BatchNor (None, 27, 27, 64) 192 conv2d_7[0][0]
__________________________________________________________________________________________________
batch_normalization_10 (BatchNo (None, 27, 27, 96) 288 conv2d_10[0][0]
__________________________________________________________________________________________________
batch_normalization_11 (BatchNo (None, 27, 27, 64) 192 conv2d_11[0][0]
__________________________________________________________________________________________________
activation_5 (Activation) (None, 27, 27, 96) 0 batch_normalization_5[0][0]
__________________________________________________________________________________________________
activation_7 (Activation) (None, 27, 27, 64) 0 batch_normalization_7[0][0]
__________________________________________________________________________________________________
activation_10 (Activation) (None, 27, 27, 96) 0 batch_normalization_10[0][0]
__________________________________________________________________________________________________
activation_11 (Activation) (None, 27, 27, 64) 0 batch_normalization_11[0][0]
__________________________________________________________________________________________________
mixed_5b (Concatenate) (None, 27, 27, 320) 0 activation_5[0][0]
activation_7[0][0]
activation_10[0][0]
activation_11[0][0]
__________________________________________________________________________________________________
conv2d_15 (Conv2D) (None, 27, 27, 32) 10240 mixed_5b[0][0]
__________________________________________________________________________________________________
batch_normalization_15 (BatchNo (None, 27, 27, 32) 96 conv2d_15[0][0]
__________________________________________________________________________________________________
activation_15 (Activation) (None, 27, 27, 32) 0 batch_normalization_15[0][0]
__________________________________________________________________________________________________
conv2d_13 (Conv2D) (None, 27, 27, 32) 10240 mixed_5b[0][0]
__________________________________________________________________________________________________
conv2d_16 (Conv2D) (None, 27, 27, 48) 13824 activation_15[0][0]
__________________________________________________________________________________________________
batch_normalization_13 (BatchNo (None, 27, 27, 32) 96 conv2d_13[0][0]
__________________________________________________________________________________________________
batch_normalization_16 (BatchNo (None, 27, 27, 48) 144 conv2d_16[0][0]
__________________________________________________________________________________________________
activation_13 (Activation) (None, 27, 27, 32) 0 batch_normalization_13[0][0]
__________________________________________________________________________________________________
activation_16 (Activation) (None, 27, 27, 48) 0 batch_normalization_16[0][0]
__________________________________________________________________________________________________
conv2d_12 (Conv2D) (None, 27, 27, 32) 10240 mixed_5b[0][0]
__________________________________________________________________________________________________
conv2d_14 (Conv2D) (None, 27, 27, 32) 9216 activation_13[0][0]
__________________________________________________________________________________________________
conv2d_17 (Conv2D) (None, 27, 27, 64) 27648 activation_16[0][0]
__________________________________________________________________________________________________
batch_normalization_12 (BatchNo (None, 27, 27, 32) 96 conv2d_12[0][0]
__________________________________________________________________________________________________
batch_normalization_14 (BatchNo (None, 27, 27, 32) 96 conv2d_14[0][0]
__________________________________________________________________________________________________
batch_normalization_17 (BatchNo (None, 27, 27, 64) 192 conv2d_17[0][0]
__________________________________________________________________________________________________
activation_12 (Activation) (None, 27, 27, 32) 0 batch_normalization_12[0][0]
__________________________________________________________________________________________________
activation_14 (Activation) (None, 27, 27, 32) 0 batch_normalization_14[0][0]
__________________________________________________________________________________________________
activation_17 (Activation) (None, 27, 27, 64) 0 batch_normalization_17[0][0]
__________________________________________________________________________________________________
block35_1_mixed (Concatenate) (None, 27, 27, 128) 0 activation_12[0][0]
activation_14[0][0]
activation_17[0][0]
__________________________________________________________________________________________________
block35_1_conv (Conv2D) (None, 27, 27, 320) 41280 block35_1_mixed[0][0]
__________________________________________________________________________________________________
block35_1 (Lambda) (None, 27, 27, 320) 0 mixed_5b[0][0]
block35_1_conv[0][0]
__________________________________________________________________________________________________
block35_1_ac (Activation) (None, 27, 27, 320) 0 block35_1[0][0]
__________________________________________________________________________________________________
conv2d_21 (Conv2D) (None, 27, 27, 32) 10240 block35_1_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_21 (BatchNo (None, 27, 27, 32) 96 conv2d_21[0][0]
__________________________________________________________________________________________________
activation_21 (Activation) (None, 27, 27, 32) 0 batch_normalization_21[0][0]
__________________________________________________________________________________________________
conv2d_19 (Conv2D) (None, 27, 27, 32) 10240 block35_1_ac[0][0]
__________________________________________________________________________________________________
conv2d_22 (Conv2D) (None, 27, 27, 48) 13824 activation_21[0][0]
__________________________________________________________________________________________________
batch_normalization_19 (BatchNo (None, 27, 27, 32) 96 conv2d_19[0][0]
__________________________________________________________________________________________________
batch_normalization_22 (BatchNo (None, 27, 27, 48) 144 conv2d_22[0][0]
__________________________________________________________________________________________________
activation_19 (Activation) (None, 27, 27, 32) 0 batch_normalization_19[0][0]
__________________________________________________________________________________________________
activation_22 (Activation) (None, 27, 27, 48) 0 batch_normalization_22[0][0]
__________________________________________________________________________________________________
conv2d_18 (Conv2D) (None, 27, 27, 32) 10240 block35_1_ac[0][0]
__________________________________________________________________________________________________
conv2d_20 (Conv2D) (None, 27, 27, 32) 9216 activation_19[0][0]
__________________________________________________________________________________________________
conv2d_23 (Conv2D) (None, 27, 27, 64) 27648 activation_22[0][0]
__________________________________________________________________________________________________
batch_normalization_18 (BatchNo (None, 27, 27, 32) 96 conv2d_18[0][0]
__________________________________________________________________________________________________
batch_normalization_20 (BatchNo (None, 27, 27, 32) 96 conv2d_20[0][0]
__________________________________________________________________________________________________
batch_normalization_23 (BatchNo (None, 27, 27, 64) 192 conv2d_23[0][0]
__________________________________________________________________________________________________
activation_18 (Activation) (None, 27, 27, 32) 0 batch_normalization_18[0][0]
__________________________________________________________________________________________________
activation_20 (Activation) (None, 27, 27, 32) 0 batch_normalization_20[0][0]
__________________________________________________________________________________________________
activation_23 (Activation) (None, 27, 27, 64) 0 batch_normalization_23[0][0]
__________________________________________________________________________________________________
block35_2_mixed (Concatenate) (None, 27, 27, 128) 0 activation_18[0][0]
activation_20[0][0]
activation_23[0][0]
__________________________________________________________________________________________________
block35_2_conv (Conv2D) (None, 27, 27, 320) 41280 block35_2_mixed[0][0]
__________________________________________________________________________________________________
block35_2 (Lambda) (None, 27, 27, 320) 0 block35_1_ac[0][0]
block35_2_conv[0][0]
__________________________________________________________________________________________________
block35_2_ac (Activation) (None, 27, 27, 320) 0 block35_2[0][0]
__________________________________________________________________________________________________
conv2d_27 (Conv2D) (None, 27, 27, 32) 10240 block35_2_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_27 (BatchNo (None, 27, 27, 32) 96 conv2d_27[0][0]
__________________________________________________________________________________________________
activation_27 (Activation) (None, 27, 27, 32) 0 batch_normalization_27[0][0]
__________________________________________________________________________________________________
conv2d_25 (Conv2D) (None, 27, 27, 32) 10240 block35_2_ac[0][0]
__________________________________________________________________________________________________
conv2d_28 (Conv2D) (None, 27, 27, 48) 13824 activation_27[0][0]
__________________________________________________________________________________________________
batch_normalization_25 (BatchNo (None, 27, 27, 32) 96 conv2d_25[0][0]
__________________________________________________________________________________________________
batch_normalization_28 (BatchNo (None, 27, 27, 48) 144 conv2d_28[0][0]
__________________________________________________________________________________________________
activation_25 (Activation) (None, 27, 27, 32) 0 batch_normalization_25[0][0]
__________________________________________________________________________________________________
activation_28 (Activation) (None, 27, 27, 48) 0 batch_normalization_28[0][0]
__________________________________________________________________________________________________
conv2d_24 (Conv2D) (None, 27, 27, 32) 10240 block35_2_ac[0][0]
__________________________________________________________________________________________________
conv2d_26 (Conv2D) (None, 27, 27, 32) 9216 activation_25[0][0]
__________________________________________________________________________________________________
conv2d_29 (Conv2D) (None, 27, 27, 64) 27648 activation_28[0][0]
__________________________________________________________________________________________________
batch_normalization_24 (BatchNo (None, 27, 27, 32) 96 conv2d_24[0][0]
__________________________________________________________________________________________________
batch_normalization_26 (BatchNo (None, 27, 27, 32) 96 conv2d_26[0][0]
__________________________________________________________________________________________________
batch_normalization_29 (BatchNo (None, 27, 27, 64) 192 conv2d_29[0][0]
__________________________________________________________________________________________________
activation_24 (Activation) (None, 27, 27, 32) 0 batch_normalization_24[0][0]
__________________________________________________________________________________________________
activation_26 (Activation) (None, 27, 27, 32) 0 batch_normalization_26[0][0]
__________________________________________________________________________________________________
activation_29 (Activation) (None, 27, 27, 64) 0 batch_normalization_29[0][0]
__________________________________________________________________________________________________
block35_3_mixed (Concatenate) (None, 27, 27, 128) 0 activation_24[0][0]
activation_26[0][0]
activation_29[0][0]
__________________________________________________________________________________________________
block35_3_conv (Conv2D) (None, 27, 27, 320) 41280 block35_3_mixed[0][0]
__________________________________________________________________________________________________
block35_3 (Lambda) (None, 27, 27, 320) 0 block35_2_ac[0][0]
block35_3_conv[0][0]
__________________________________________________________________________________________________
block35_3_ac (Activation) (None, 27, 27, 320) 0 block35_3[0][0]
__________________________________________________________________________________________________
conv2d_33 (Conv2D) (None, 27, 27, 32) 10240 block35_3_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_33 (BatchNo (None, 27, 27, 32) 96 conv2d_33[0][0]
__________________________________________________________________________________________________
activation_33 (Activation) (None, 27, 27, 32) 0 batch_normalization_33[0][0]
__________________________________________________________________________________________________
conv2d_31 (Conv2D) (None, 27, 27, 32) 10240 block35_3_ac[0][0]
__________________________________________________________________________________________________
conv2d_34 (Conv2D) (None, 27, 27, 48) 13824 activation_33[0][0]
__________________________________________________________________________________________________
batch_normalization_31 (BatchNo (None, 27, 27, 32) 96 conv2d_31[0][0]
__________________________________________________________________________________________________
batch_normalization_34 (BatchNo (None, 27, 27, 48) 144 conv2d_34[0][0]
__________________________________________________________________________________________________
activation_31 (Activation) (None, 27, 27, 32) 0 batch_normalization_31[0][0]
__________________________________________________________________________________________________
activation_34 (Activation) (None, 27, 27, 48) 0 batch_normalization_34[0][0]
__________________________________________________________________________________________________
conv2d_30 (Conv2D) (None, 27, 27, 32) 10240 block35_3_ac[0][0]
__________________________________________________________________________________________________
conv2d_32 (Conv2D) (None, 27, 27, 32) 9216 activation_31[0][0]
__________________________________________________________________________________________________
conv2d_35 (Conv2D) (None, 27, 27, 64) 27648 activation_34[0][0]
__________________________________________________________________________________________________
batch_normalization_30 (BatchNo (None, 27, 27, 32) 96 conv2d_30[0][0]
__________________________________________________________________________________________________
batch_normalization_32 (BatchNo (None, 27, 27, 32) 96 conv2d_32[0][0]
__________________________________________________________________________________________________
batch_normalization_35 (BatchNo (None, 27, 27, 64) 192 conv2d_35[0][0]
__________________________________________________________________________________________________
activation_30 (Activation) (None, 27, 27, 32) 0 batch_normalization_30[0][0]
__________________________________________________________________________________________________
activation_32 (Activation) (None, 27, 27, 32) 0 batch_normalization_32[0][0]
__________________________________________________________________________________________________
activation_35 (Activation) (None, 27, 27, 64) 0 batch_normalization_35[0][0]
__________________________________________________________________________________________________
block35_4_mixed (Concatenate) (None, 27, 27, 128) 0 activation_30[0][0]
activation_32[0][0]
activation_35[0][0]
__________________________________________________________________________________________________
block35_4_conv (Conv2D) (None, 27, 27, 320) 41280 block35_4_mixed[0][0]
__________________________________________________________________________________________________
block35_4 (Lambda) (None, 27, 27, 320) 0 block35_3_ac[0][0]
block35_4_conv[0][0]
__________________________________________________________________________________________________
block35_4_ac (Activation) (None, 27, 27, 320) 0 block35_4[0][0]
__________________________________________________________________________________________________
conv2d_39 (Conv2D) (None, 27, 27, 32) 10240 block35_4_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_39 (BatchNo (None, 27, 27, 32) 96 conv2d_39[0][0]
__________________________________________________________________________________________________
activation_39 (Activation) (None, 27, 27, 32) 0 batch_normalization_39[0][0]
__________________________________________________________________________________________________
conv2d_37 (Conv2D) (None, 27, 27, 32) 10240 block35_4_ac[0][0]
__________________________________________________________________________________________________
conv2d_40 (Conv2D) (None, 27, 27, 48) 13824 activation_39[0][0]
__________________________________________________________________________________________________
batch_normalization_37 (BatchNo (None, 27, 27, 32) 96 conv2d_37[0][0]
__________________________________________________________________________________________________
batch_normalization_40 (BatchNo (None, 27, 27, 48) 144 conv2d_40[0][0]
__________________________________________________________________________________________________
activation_37 (Activation) (None, 27, 27, 32) 0 batch_normalization_37[0][0]
__________________________________________________________________________________________________
activation_40 (Activation) (None, 27, 27, 48) 0 batch_normalization_40[0][0]
__________________________________________________________________________________________________
conv2d_36 (Conv2D) (None, 27, 27, 32) 10240 block35_4_ac[0][0]
__________________________________________________________________________________________________
conv2d_38 (Conv2D) (None, 27, 27, 32) 9216 activation_37[0][0]
__________________________________________________________________________________________________
conv2d_41 (Conv2D) (None, 27, 27, 64) 27648 activation_40[0][0]
__________________________________________________________________________________________________
batch_normalization_36 (BatchNo (None, 27, 27, 32) 96 conv2d_36[0][0]
__________________________________________________________________________________________________
batch_normalization_38 (BatchNo (None, 27, 27, 32) 96 conv2d_38[0][0]
__________________________________________________________________________________________________
batch_normalization_41 (BatchNo (None, 27, 27, 64) 192 conv2d_41[0][0]
__________________________________________________________________________________________________
activation_36 (Activation) (None, 27, 27, 32) 0 batch_normalization_36[0][0]
__________________________________________________________________________________________________
activation_38 (Activation) (None, 27, 27, 32) 0 batch_normalization_38[0][0]
__________________________________________________________________________________________________
activation_41 (Activation) (None, 27, 27, 64) 0 batch_normalization_41[0][0]
__________________________________________________________________________________________________
block35_5_mixed (Concatenate) (None, 27, 27, 128) 0 activation_36[0][0]
activation_38[0][0]
activation_41[0][0]
__________________________________________________________________________________________________
block35_5_conv (Conv2D) (None, 27, 27, 320) 41280 block35_5_mixed[0][0]
__________________________________________________________________________________________________
block35_5 (Lambda) (None, 27, 27, 320) 0 block35_4_ac[0][0]
block35_5_conv[0][0]
__________________________________________________________________________________________________
block35_5_ac (Activation) (None, 27, 27, 320) 0 block35_5[0][0]
__________________________________________________________________________________________________
conv2d_45 (Conv2D) (None, 27, 27, 32) 10240 block35_5_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_45 (BatchNo (None, 27, 27, 32) 96 conv2d_45[0][0]
__________________________________________________________________________________________________
activation_45 (Activation) (None, 27, 27, 32) 0 batch_normalization_45[0][0]
__________________________________________________________________________________________________
conv2d_43 (Conv2D) (None, 27, 27, 32) 10240 block35_5_ac[0][0]
__________________________________________________________________________________________________
conv2d_46 (Conv2D) (None, 27, 27, 48) 13824 activation_45[0][0]
__________________________________________________________________________________________________
batch_normalization_43 (BatchNo (None, 27, 27, 32) 96 conv2d_43[0][0]
__________________________________________________________________________________________________
batch_normalization_46 (BatchNo (None, 27, 27, 48) 144 conv2d_46[0][0]
__________________________________________________________________________________________________
activation_43 (Activation) (None, 27, 27, 32) 0 batch_normalization_43[0][0]
__________________________________________________________________________________________________
activation_46 (Activation) (None, 27, 27, 48) 0 batch_normalization_46[0][0]
__________________________________________________________________________________________________
conv2d_42 (Conv2D) (None, 27, 27, 32) 10240 block35_5_ac[0][0]
__________________________________________________________________________________________________
conv2d_44 (Conv2D) (None, 27, 27, 32) 9216 activation_43[0][0]
__________________________________________________________________________________________________
conv2d_47 (Conv2D) (None, 27, 27, 64) 27648 activation_46[0][0]
__________________________________________________________________________________________________
batch_normalization_42 (BatchNo (None, 27, 27, 32) 96 conv2d_42[0][0]
__________________________________________________________________________________________________
batch_normalization_44 (BatchNo (None, 27, 27, 32) 96 conv2d_44[0][0]
__________________________________________________________________________________________________
batch_normalization_47 (BatchNo (None, 27, 27, 64) 192 conv2d_47[0][0]
__________________________________________________________________________________________________
activation_42 (Activation) (None, 27, 27, 32) 0 batch_normalization_42[0][0]
__________________________________________________________________________________________________
activation_44 (Activation) (None, 27, 27, 32) 0 batch_normalization_44[0][0]
__________________________________________________________________________________________________
activation_47 (Activation) (None, 27, 27, 64) 0 batch_normalization_47[0][0]
__________________________________________________________________________________________________
block35_6_mixed (Concatenate) (None, 27, 27, 128) 0 activation_42[0][0]
activation_44[0][0]
activation_47[0][0]
__________________________________________________________________________________________________
block35_6_conv (Conv2D) (None, 27, 27, 320) 41280 block35_6_mixed[0][0]
__________________________________________________________________________________________________
block35_6 (Lambda) (None, 27, 27, 320) 0 block35_5_ac[0][0]
block35_6_conv[0][0]
__________________________________________________________________________________________________
block35_6_ac (Activation) (None, 27, 27, 320) 0 block35_6[0][0]
__________________________________________________________________________________________________
conv2d_51 (Conv2D) (None, 27, 27, 32) 10240 block35_6_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_51 (BatchNo (None, 27, 27, 32) 96 conv2d_51[0][0]
__________________________________________________________________________________________________
activation_51 (Activation) (None, 27, 27, 32) 0 batch_normalization_51[0][0]
__________________________________________________________________________________________________
conv2d_49 (Conv2D) (None, 27, 27, 32) 10240 block35_6_ac[0][0]
__________________________________________________________________________________________________
conv2d_52 (Conv2D) (None, 27, 27, 48) 13824 activation_51[0][0]
__________________________________________________________________________________________________
batch_normalization_49 (BatchNo (None, 27, 27, 32) 96 conv2d_49[0][0]
__________________________________________________________________________________________________
batch_normalization_52 (BatchNo (None, 27, 27, 48) 144 conv2d_52[0][0]
__________________________________________________________________________________________________
activation_49 (Activation) (None, 27, 27, 32) 0 batch_normalization_49[0][0]
__________________________________________________________________________________________________
activation_52 (Activation) (None, 27, 27, 48) 0 batch_normalization_52[0][0]
__________________________________________________________________________________________________
conv2d_48 (Conv2D) (None, 27, 27, 32) 10240 block35_6_ac[0][0]
__________________________________________________________________________________________________
conv2d_50 (Conv2D) (None, 27, 27, 32) 9216 activation_49[0][0]
__________________________________________________________________________________________________
conv2d_53 (Conv2D) (None, 27, 27, 64) 27648 activation_52[0][0]
__________________________________________________________________________________________________
batch_normalization_48 (BatchNo (None, 27, 27, 32) 96 conv2d_48[0][0]
__________________________________________________________________________________________________
batch_normalization_50 (BatchNo (None, 27, 27, 32) 96 conv2d_50[0][0]
__________________________________________________________________________________________________
batch_normalization_53 (BatchNo (None, 27, 27, 64) 192 conv2d_53[0][0]
__________________________________________________________________________________________________
activation_48 (Activation) (None, 27, 27, 32) 0 batch_normalization_48[0][0]
__________________________________________________________________________________________________
activation_50 (Activation) (None, 27, 27, 32) 0 batch_normalization_50[0][0]
__________________________________________________________________________________________________
activation_53 (Activation) (None, 27, 27, 64) 0 batch_normalization_53[0][0]
__________________________________________________________________________________________________
block35_7_mixed (Concatenate) (None, 27, 27, 128) 0 activation_48[0][0]
activation_50[0][0]
activation_53[0][0]
__________________________________________________________________________________________________
block35_7_conv (Conv2D) (None, 27, 27, 320) 41280 block35_7_mixed[0][0]
__________________________________________________________________________________________________
block35_7 (Lambda) (None, 27, 27, 320) 0 block35_6_ac[0][0]
block35_7_conv[0][0]
__________________________________________________________________________________________________
block35_7_ac (Activation) (None, 27, 27, 320) 0 block35_7[0][0]
__________________________________________________________________________________________________
conv2d_57 (Conv2D) (None, 27, 27, 32) 10240 block35_7_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_57 (BatchNo (None, 27, 27, 32) 96 conv2d_57[0][0]
__________________________________________________________________________________________________
activation_57 (Activation) (None, 27, 27, 32) 0 batch_normalization_57[0][0]
__________________________________________________________________________________________________
conv2d_55 (Conv2D) (None, 27, 27, 32) 10240 block35_7_ac[0][0]
__________________________________________________________________________________________________
conv2d_58 (Conv2D) (None, 27, 27, 48) 13824 activation_57[0][0]
__________________________________________________________________________________________________
batch_normalization_55 (BatchNo (None, 27, 27, 32) 96 conv2d_55[0][0]
__________________________________________________________________________________________________
batch_normalization_58 (BatchNo (None, 27, 27, 48) 144 conv2d_58[0][0]
__________________________________________________________________________________________________
activation_55 (Activation) (None, 27, 27, 32) 0 batch_normalization_55[0][0]
__________________________________________________________________________________________________
activation_58 (Activation) (None, 27, 27, 48) 0 batch_normalization_58[0][0]
__________________________________________________________________________________________________
conv2d_54 (Conv2D) (None, 27, 27, 32) 10240 block35_7_ac[0][0]
__________________________________________________________________________________________________
conv2d_56 (Conv2D) (None, 27, 27, 32) 9216 activation_55[0][0]
__________________________________________________________________________________________________
conv2d_59 (Conv2D) (None, 27, 27, 64) 27648 activation_58[0][0]
__________________________________________________________________________________________________
batch_normalization_54 (BatchNo (None, 27, 27, 32) 96 conv2d_54[0][0]
__________________________________________________________________________________________________
batch_normalization_56 (BatchNo (None, 27, 27, 32) 96 conv2d_56[0][0]
__________________________________________________________________________________________________
batch_normalization_59 (BatchNo (None, 27, 27, 64) 192 conv2d_59[0][0]
__________________________________________________________________________________________________
activation_54 (Activation) (None, 27, 27, 32) 0 batch_normalization_54[0][0]
__________________________________________________________________________________________________
activation_56 (Activation) (None, 27, 27, 32) 0 batch_normalization_56[0][0]
__________________________________________________________________________________________________
activation_59 (Activation) (None, 27, 27, 64) 0 batch_normalization_59[0][0]
__________________________________________________________________________________________________
block35_8_mixed (Concatenate) (None, 27, 27, 128) 0 activation_54[0][0]
activation_56[0][0]
activation_59[0][0]
__________________________________________________________________________________________________
block35_8_conv (Conv2D) (None, 27, 27, 320) 41280 block35_8_mixed[0][0]
__________________________________________________________________________________________________
block35_8 (Lambda) (None, 27, 27, 320) 0 block35_7_ac[0][0]
block35_8_conv[0][0]
__________________________________________________________________________________________________
block35_8_ac (Activation) (None, 27, 27, 320) 0 block35_8[0][0]
__________________________________________________________________________________________________
conv2d_63 (Conv2D) (None, 27, 27, 32) 10240 block35_8_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_63 (BatchNo (None, 27, 27, 32) 96 conv2d_63[0][0]
__________________________________________________________________________________________________
activation_63 (Activation) (None, 27, 27, 32) 0 batch_normalization_63[0][0]
__________________________________________________________________________________________________
conv2d_61 (Conv2D) (None, 27, 27, 32) 10240 block35_8_ac[0][0]
__________________________________________________________________________________________________
conv2d_64 (Conv2D) (None, 27, 27, 48) 13824 activation_63[0][0]
__________________________________________________________________________________________________
batch_normalization_61 (BatchNo (None, 27, 27, 32) 96 conv2d_61[0][0]
__________________________________________________________________________________________________
batch_normalization_64 (BatchNo (None, 27, 27, 48) 144 conv2d_64[0][0]
__________________________________________________________________________________________________
activation_61 (Activation) (None, 27, 27, 32) 0 batch_normalization_61[0][0]
__________________________________________________________________________________________________
activation_64 (Activation) (None, 27, 27, 48) 0 batch_normalization_64[0][0]
__________________________________________________________________________________________________
conv2d_60 (Conv2D) (None, 27, 27, 32) 10240 block35_8_ac[0][0]
__________________________________________________________________________________________________
conv2d_62 (Conv2D) (None, 27, 27, 32) 9216 activation_61[0][0]
__________________________________________________________________________________________________
conv2d_65 (Conv2D) (None, 27, 27, 64) 27648 activation_64[0][0]
__________________________________________________________________________________________________
batch_normalization_60 (BatchNo (None, 27, 27, 32) 96 conv2d_60[0][0]
__________________________________________________________________________________________________
batch_normalization_62 (BatchNo (None, 27, 27, 32) 96 conv2d_62[0][0]
__________________________________________________________________________________________________
batch_normalization_65 (BatchNo (None, 27, 27, 64) 192 conv2d_65[0][0]
__________________________________________________________________________________________________
activation_60 (Activation) (None, 27, 27, 32) 0 batch_normalization_60[0][0]
__________________________________________________________________________________________________
activation_62 (Activation) (None, 27, 27, 32) 0 batch_normalization_62[0][0]
__________________________________________________________________________________________________
activation_65 (Activation) (None, 27, 27, 64) 0 batch_normalization_65[0][0]
__________________________________________________________________________________________________
block35_9_mixed (Concatenate) (None, 27, 27, 128) 0 activation_60[0][0]
activation_62[0][0]
activation_65[0][0]
__________________________________________________________________________________________________
block35_9_conv (Conv2D) (None, 27, 27, 320) 41280 block35_9_mixed[0][0]
__________________________________________________________________________________________________
block35_9 (Lambda) (None, 27, 27, 320) 0 block35_8_ac[0][0]
block35_9_conv[0][0]
__________________________________________________________________________________________________
block35_9_ac (Activation) (None, 27, 27, 320) 0 block35_9[0][0]
__________________________________________________________________________________________________
conv2d_69 (Conv2D) (None, 27, 27, 32) 10240 block35_9_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_69 (BatchNo (None, 27, 27, 32) 96 conv2d_69[0][0]
__________________________________________________________________________________________________
activation_69 (Activation) (None, 27, 27, 32) 0 batch_normalization_69[0][0]
__________________________________________________________________________________________________
conv2d_67 (Conv2D) (None, 27, 27, 32) 10240 block35_9_ac[0][0]
__________________________________________________________________________________________________
conv2d_70 (Conv2D) (None, 27, 27, 48) 13824 activation_69[0][0]
__________________________________________________________________________________________________
batch_normalization_67 (BatchNo (None, 27, 27, 32) 96 conv2d_67[0][0]
__________________________________________________________________________________________________
batch_normalization_70 (BatchNo (None, 27, 27, 48) 144 conv2d_70[0][0]
__________________________________________________________________________________________________
activation_67 (Activation) (None, 27, 27, 32) 0 batch_normalization_67[0][0]
__________________________________________________________________________________________________
activation_70 (Activation) (None, 27, 27, 48) 0 batch_normalization_70[0][0]
__________________________________________________________________________________________________
conv2d_66 (Conv2D) (None, 27, 27, 32) 10240 block35_9_ac[0][0]
__________________________________________________________________________________________________
conv2d_68 (Conv2D) (None, 27, 27, 32) 9216 activation_67[0][0]
__________________________________________________________________________________________________
conv2d_71 (Conv2D) (None, 27, 27, 64) 27648 activation_70[0][0]
__________________________________________________________________________________________________
batch_normalization_66 (BatchNo (None, 27, 27, 32) 96 conv2d_66[0][0]
__________________________________________________________________________________________________
batch_normalization_68 (BatchNo (None, 27, 27, 32) 96 conv2d_68[0][0]
__________________________________________________________________________________________________
batch_normalization_71 (BatchNo (None, 27, 27, 64) 192 conv2d_71[0][0]
__________________________________________________________________________________________________
activation_66 (Activation) (None, 27, 27, 32) 0 batch_normalization_66[0][0]
__________________________________________________________________________________________________
activation_68 (Activation) (None, 27, 27, 32) 0 batch_normalization_68[0][0]
__________________________________________________________________________________________________
activation_71 (Activation) (None, 27, 27, 64) 0 batch_normalization_71[0][0]
__________________________________________________________________________________________________
block35_10_mixed (Concatenate) (None, 27, 27, 128) 0 activation_66[0][0]
activation_68[0][0]
activation_71[0][0]
__________________________________________________________________________________________________
block35_10_conv (Conv2D) (None, 27, 27, 320) 41280 block35_10_mixed[0][0]
__________________________________________________________________________________________________
block35_10 (Lambda) (None, 27, 27, 320) 0 block35_9_ac[0][0]
block35_10_conv[0][0]
__________________________________________________________________________________________________
block35_10_ac (Activation) (None, 27, 27, 320) 0 block35_10[0][0]
__________________________________________________________________________________________________
conv2d_73 (Conv2D) (None, 27, 27, 256) 81920 block35_10_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_73 (BatchNo (None, 27, 27, 256) 768 conv2d_73[0][0]
__________________________________________________________________________________________________
activation_73 (Activation) (None, 27, 27, 256) 0 batch_normalization_73[0][0]
__________________________________________________________________________________________________
conv2d_74 (Conv2D) (None, 27, 27, 256) 589824 activation_73[0][0]
__________________________________________________________________________________________________
batch_normalization_74 (BatchNo (None, 27, 27, 256) 768 conv2d_74[0][0]
__________________________________________________________________________________________________
activation_74 (Activation) (None, 27, 27, 256) 0 batch_normalization_74[0][0]
__________________________________________________________________________________________________
conv2d_72 (Conv2D) (None, 13, 13, 384) 1105920 block35_10_ac[0][0]
__________________________________________________________________________________________________
conv2d_75 (Conv2D) (None, 13, 13, 384) 884736 activation_74[0][0]
__________________________________________________________________________________________________
batch_normalization_72 (BatchNo (None, 13, 13, 384) 1152 conv2d_72[0][0]
__________________________________________________________________________________________________
batch_normalization_75 (BatchNo (None, 13, 13, 384) 1152 conv2d_75[0][0]
__________________________________________________________________________________________________
activation_72 (Activation) (None, 13, 13, 384) 0 batch_normalization_72[0][0]
__________________________________________________________________________________________________
activation_75 (Activation) (None, 13, 13, 384) 0 batch_normalization_75[0][0]
__________________________________________________________________________________________________
max_pooling2d_2 (MaxPooling2D) (None, 13, 13, 320) 0 block35_10_ac[0][0]
__________________________________________________________________________________________________
mixed_6a (Concatenate) (None, 13, 13, 1088) 0 activation_72[0][0]
activation_75[0][0]
max_pooling2d_2[0][0]
__________________________________________________________________________________________________
conv2d_77 (Conv2D) (None, 13, 13, 128) 139264 mixed_6a[0][0]
__________________________________________________________________________________________________
batch_normalization_77 (BatchNo (None, 13, 13, 128) 384 conv2d_77[0][0]
__________________________________________________________________________________________________
activation_77 (Activation) (None, 13, 13, 128) 0 batch_normalization_77[0][0]
__________________________________________________________________________________________________
conv2d_78 (Conv2D) (None, 13, 13, 160) 143360 activation_77[0][0]
__________________________________________________________________________________________________
batch_normalization_78 (BatchNo (None, 13, 13, 160) 480 conv2d_78[0][0]
__________________________________________________________________________________________________
activation_78 (Activation) (None, 13, 13, 160) 0 batch_normalization_78[0][0]
__________________________________________________________________________________________________
conv2d_76 (Conv2D) (None, 13, 13, 192) 208896 mixed_6a[0][0]
__________________________________________________________________________________________________
conv2d_79 (Conv2D) (None, 13, 13, 192) 215040 activation_78[0][0]
__________________________________________________________________________________________________
batch_normalization_76 (BatchNo (None, 13, 13, 192) 576 conv2d_76[0][0]
__________________________________________________________________________________________________
batch_normalization_79 (BatchNo (None, 13, 13, 192) 576 conv2d_79[0][0]
__________________________________________________________________________________________________
activation_76 (Activation) (None, 13, 13, 192) 0 batch_normalization_76[0][0]
__________________________________________________________________________________________________
activation_79 (Activation) (None, 13, 13, 192) 0 batch_normalization_79[0][0]
__________________________________________________________________________________________________
block17_1_mixed (Concatenate) (None, 13, 13, 384) 0 activation_76[0][0]
activation_79[0][0]
__________________________________________________________________________________________________
block17_1_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_1_mixed[0][0]
__________________________________________________________________________________________________
block17_1 (Lambda) (None, 13, 13, 1088) 0 mixed_6a[0][0]
block17_1_conv[0][0]
__________________________________________________________________________________________________
block17_1_ac (Activation) (None, 13, 13, 1088) 0 block17_1[0][0]
__________________________________________________________________________________________________
conv2d_81 (Conv2D) (None, 13, 13, 128) 139264 block17_1_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_81 (BatchNo (None, 13, 13, 128) 384 conv2d_81[0][0]
__________________________________________________________________________________________________
activation_81 (Activation) (None, 13, 13, 128) 0 batch_normalization_81[0][0]
__________________________________________________________________________________________________
conv2d_82 (Conv2D) (None, 13, 13, 160) 143360 activation_81[0][0]
__________________________________________________________________________________________________
batch_normalization_82 (BatchNo (None, 13, 13, 160) 480 conv2d_82[0][0]
__________________________________________________________________________________________________
activation_82 (Activation) (None, 13, 13, 160) 0 batch_normalization_82[0][0]
__________________________________________________________________________________________________
conv2d_80 (Conv2D) (None, 13, 13, 192) 208896 block17_1_ac[0][0]
__________________________________________________________________________________________________
conv2d_83 (Conv2D) (None, 13, 13, 192) 215040 activation_82[0][0]
__________________________________________________________________________________________________
batch_normalization_80 (BatchNo (None, 13, 13, 192) 576 conv2d_80[0][0]
__________________________________________________________________________________________________
batch_normalization_83 (BatchNo (None, 13, 13, 192) 576 conv2d_83[0][0]
__________________________________________________________________________________________________
activation_80 (Activation) (None, 13, 13, 192) 0 batch_normalization_80[0][0]
__________________________________________________________________________________________________
activation_83 (Activation) (None, 13, 13, 192) 0 batch_normalization_83[0][0]
__________________________________________________________________________________________________
block17_2_mixed (Concatenate) (None, 13, 13, 384) 0 activation_80[0][0]
activation_83[0][0]
__________________________________________________________________________________________________
block17_2_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_2_mixed[0][0]
__________________________________________________________________________________________________
block17_2 (Lambda) (None, 13, 13, 1088) 0 block17_1_ac[0][0]
block17_2_conv[0][0]
__________________________________________________________________________________________________
block17_2_ac (Activation) (None, 13, 13, 1088) 0 block17_2[0][0]
__________________________________________________________________________________________________
conv2d_85 (Conv2D) (None, 13, 13, 128) 139264 block17_2_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_85 (BatchNo (None, 13, 13, 128) 384 conv2d_85[0][0]
__________________________________________________________________________________________________
activation_85 (Activation) (None, 13, 13, 128) 0 batch_normalization_85[0][0]
__________________________________________________________________________________________________
conv2d_86 (Conv2D) (None, 13, 13, 160) 143360 activation_85[0][0]
__________________________________________________________________________________________________
batch_normalization_86 (BatchNo (None, 13, 13, 160) 480 conv2d_86[0][0]
__________________________________________________________________________________________________
activation_86 (Activation) (None, 13, 13, 160) 0 batch_normalization_86[0][0]
__________________________________________________________________________________________________
conv2d_84 (Conv2D) (None, 13, 13, 192) 208896 block17_2_ac[0][0]
__________________________________________________________________________________________________
conv2d_87 (Conv2D) (None, 13, 13, 192) 215040 activation_86[0][0]
__________________________________________________________________________________________________
batch_normalization_84 (BatchNo (None, 13, 13, 192) 576 conv2d_84[0][0]
__________________________________________________________________________________________________
batch_normalization_87 (BatchNo (None, 13, 13, 192) 576 conv2d_87[0][0]
__________________________________________________________________________________________________
activation_84 (Activation) (None, 13, 13, 192) 0 batch_normalization_84[0][0]
__________________________________________________________________________________________________
activation_87 (Activation) (None, 13, 13, 192) 0 batch_normalization_87[0][0]
__________________________________________________________________________________________________
block17_3_mixed (Concatenate) (None, 13, 13, 384) 0 activation_84[0][0]
activation_87[0][0]
__________________________________________________________________________________________________
block17_3_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_3_mixed[0][0]
__________________________________________________________________________________________________
block17_3 (Lambda) (None, 13, 13, 1088) 0 block17_2_ac[0][0]
block17_3_conv[0][0]
__________________________________________________________________________________________________
block17_3_ac (Activation) (None, 13, 13, 1088) 0 block17_3[0][0]
__________________________________________________________________________________________________
conv2d_89 (Conv2D) (None, 13, 13, 128) 139264 block17_3_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_89 (BatchNo (None, 13, 13, 128) 384 conv2d_89[0][0]
__________________________________________________________________________________________________
activation_89 (Activation) (None, 13, 13, 128) 0 batch_normalization_89[0][0]
__________________________________________________________________________________________________
conv2d_90 (Conv2D) (None, 13, 13, 160) 143360 activation_89[0][0]
__________________________________________________________________________________________________
batch_normalization_90 (BatchNo (None, 13, 13, 160) 480 conv2d_90[0][0]
__________________________________________________________________________________________________
activation_90 (Activation) (None, 13, 13, 160) 0 batch_normalization_90[0][0]
__________________________________________________________________________________________________
conv2d_88 (Conv2D) (None, 13, 13, 192) 208896 block17_3_ac[0][0]
__________________________________________________________________________________________________
conv2d_91 (Conv2D) (None, 13, 13, 192) 215040 activation_90[0][0]
__________________________________________________________________________________________________
batch_normalization_88 (BatchNo (None, 13, 13, 192) 576 conv2d_88[0][0]
__________________________________________________________________________________________________
batch_normalization_91 (BatchNo (None, 13, 13, 192) 576 conv2d_91[0][0]
__________________________________________________________________________________________________
activation_88 (Activation) (None, 13, 13, 192) 0 batch_normalization_88[0][0]
__________________________________________________________________________________________________
activation_91 (Activation) (None, 13, 13, 192) 0 batch_normalization_91[0][0]
__________________________________________________________________________________________________
block17_4_mixed (Concatenate) (None, 13, 13, 384) 0 activation_88[0][0]
activation_91[0][0]
__________________________________________________________________________________________________
block17_4_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_4_mixed[0][0]
__________________________________________________________________________________________________
block17_4 (Lambda) (None, 13, 13, 1088) 0 block17_3_ac[0][0]
block17_4_conv[0][0]
__________________________________________________________________________________________________
block17_4_ac (Activation) (None, 13, 13, 1088) 0 block17_4[0][0]
__________________________________________________________________________________________________
conv2d_93 (Conv2D) (None, 13, 13, 128) 139264 block17_4_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_93 (BatchNo (None, 13, 13, 128) 384 conv2d_93[0][0]
__________________________________________________________________________________________________
activation_93 (Activation) (None, 13, 13, 128) 0 batch_normalization_93[0][0]
__________________________________________________________________________________________________
conv2d_94 (Conv2D) (None, 13, 13, 160) 143360 activation_93[0][0]
__________________________________________________________________________________________________
batch_normalization_94 (BatchNo (None, 13, 13, 160) 480 conv2d_94[0][0]
__________________________________________________________________________________________________
activation_94 (Activation) (None, 13, 13, 160) 0 batch_normalization_94[0][0]
__________________________________________________________________________________________________
conv2d_92 (Conv2D) (None, 13, 13, 192) 208896 block17_4_ac[0][0]
__________________________________________________________________________________________________
conv2d_95 (Conv2D) (None, 13, 13, 192) 215040 activation_94[0][0]
__________________________________________________________________________________________________
batch_normalization_92 (BatchNo (None, 13, 13, 192) 576 conv2d_92[0][0]
__________________________________________________________________________________________________
batch_normalization_95 (BatchNo (None, 13, 13, 192) 576 conv2d_95[0][0]
__________________________________________________________________________________________________
activation_92 (Activation) (None, 13, 13, 192) 0 batch_normalization_92[0][0]
__________________________________________________________________________________________________
activation_95 (Activation) (None, 13, 13, 192) 0 batch_normalization_95[0][0]
__________________________________________________________________________________________________
block17_5_mixed (Concatenate) (None, 13, 13, 384) 0 activation_92[0][0]
activation_95[0][0]
__________________________________________________________________________________________________
block17_5_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_5_mixed[0][0]
__________________________________________________________________________________________________
block17_5 (Lambda) (None, 13, 13, 1088) 0 block17_4_ac[0][0]
block17_5_conv[0][0]
__________________________________________________________________________________________________
block17_5_ac (Activation) (None, 13, 13, 1088) 0 block17_5[0][0]
__________________________________________________________________________________________________
conv2d_97 (Conv2D) (None, 13, 13, 128) 139264 block17_5_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_97 (BatchNo (None, 13, 13, 128) 384 conv2d_97[0][0]
__________________________________________________________________________________________________
activation_97 (Activation) (None, 13, 13, 128) 0 batch_normalization_97[0][0]
__________________________________________________________________________________________________
conv2d_98 (Conv2D) (None, 13, 13, 160) 143360 activation_97[0][0]
__________________________________________________________________________________________________
batch_normalization_98 (BatchNo (None, 13, 13, 160) 480 conv2d_98[0][0]
__________________________________________________________________________________________________
activation_98 (Activation) (None, 13, 13, 160) 0 batch_normalization_98[0][0]
__________________________________________________________________________________________________
conv2d_96 (Conv2D) (None, 13, 13, 192) 208896 block17_5_ac[0][0]
__________________________________________________________________________________________________
conv2d_99 (Conv2D) (None, 13, 13, 192) 215040 activation_98[0][0]
__________________________________________________________________________________________________
batch_normalization_96 (BatchNo (None, 13, 13, 192) 576 conv2d_96[0][0]
__________________________________________________________________________________________________
batch_normalization_99 (BatchNo (None, 13, 13, 192) 576 conv2d_99[0][0]
__________________________________________________________________________________________________
activation_96 (Activation) (None, 13, 13, 192) 0 batch_normalization_96[0][0]
__________________________________________________________________________________________________
activation_99 (Activation) (None, 13, 13, 192) 0 batch_normalization_99[0][0]
__________________________________________________________________________________________________
block17_6_mixed (Concatenate) (None, 13, 13, 384) 0 activation_96[0][0]
activation_99[0][0]
__________________________________________________________________________________________________
block17_6_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_6_mixed[0][0]
__________________________________________________________________________________________________
block17_6 (Lambda) (None, 13, 13, 1088) 0 block17_5_ac[0][0]
block17_6_conv[0][0]
__________________________________________________________________________________________________
block17_6_ac (Activation) (None, 13, 13, 1088) 0 block17_6[0][0]
__________________________________________________________________________________________________
conv2d_101 (Conv2D) (None, 13, 13, 128) 139264 block17_6_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_101 (BatchN (None, 13, 13, 128) 384 conv2d_101[0][0]
__________________________________________________________________________________________________
activation_101 (Activation) (None, 13, 13, 128) 0 batch_normalization_101[0][0]
__________________________________________________________________________________________________
conv2d_102 (Conv2D) (None, 13, 13, 160) 143360 activation_101[0][0]
__________________________________________________________________________________________________
batch_normalization_102 (BatchN (None, 13, 13, 160) 480 conv2d_102[0][0]
__________________________________________________________________________________________________
activation_102 (Activation) (None, 13, 13, 160) 0 batch_normalization_102[0][0]
__________________________________________________________________________________________________
conv2d_100 (Conv2D) (None, 13, 13, 192) 208896 block17_6_ac[0][0]
__________________________________________________________________________________________________
conv2d_103 (Conv2D) (None, 13, 13, 192) 215040 activation_102[0][0]
__________________________________________________________________________________________________
batch_normalization_100 (BatchN (None, 13, 13, 192) 576 conv2d_100[0][0]
__________________________________________________________________________________________________
batch_normalization_103 (BatchN (None, 13, 13, 192) 576 conv2d_103[0][0]
__________________________________________________________________________________________________
activation_100 (Activation) (None, 13, 13, 192) 0 batch_normalization_100[0][0]
__________________________________________________________________________________________________
activation_103 (Activation) (None, 13, 13, 192) 0 batch_normalization_103[0][0]
__________________________________________________________________________________________________
block17_7_mixed (Concatenate) (None, 13, 13, 384) 0 activation_100[0][0]
activation_103[0][0]
__________________________________________________________________________________________________
block17_7_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_7_mixed[0][0]
__________________________________________________________________________________________________
block17_7 (Lambda) (None, 13, 13, 1088) 0 block17_6_ac[0][0]
block17_7_conv[0][0]
__________________________________________________________________________________________________
block17_7_ac (Activation) (None, 13, 13, 1088) 0 block17_7[0][0]
__________________________________________________________________________________________________
conv2d_105 (Conv2D) (None, 13, 13, 128) 139264 block17_7_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_105 (BatchN (None, 13, 13, 128) 384 conv2d_105[0][0]
__________________________________________________________________________________________________
activation_105 (Activation) (None, 13, 13, 128) 0 batch_normalization_105[0][0]
__________________________________________________________________________________________________
conv2d_106 (Conv2D) (None, 13, 13, 160) 143360 activation_105[0][0]
__________________________________________________________________________________________________
batch_normalization_106 (BatchN (None, 13, 13, 160) 480 conv2d_106[0][0]
__________________________________________________________________________________________________
activation_106 (Activation) (None, 13, 13, 160) 0 batch_normalization_106[0][0]
__________________________________________________________________________________________________
conv2d_104 (Conv2D) (None, 13, 13, 192) 208896 block17_7_ac[0][0]
__________________________________________________________________________________________________
conv2d_107 (Conv2D) (None, 13, 13, 192) 215040 activation_106[0][0]
__________________________________________________________________________________________________
batch_normalization_104 (BatchN (None, 13, 13, 192) 576 conv2d_104[0][0]
__________________________________________________________________________________________________
batch_normalization_107 (BatchN (None, 13, 13, 192) 576 conv2d_107[0][0]
__________________________________________________________________________________________________
activation_104 (Activation) (None, 13, 13, 192) 0 batch_normalization_104[0][0]
__________________________________________________________________________________________________
activation_107 (Activation) (None, 13, 13, 192) 0 batch_normalization_107[0][0]
__________________________________________________________________________________________________
block17_8_mixed (Concatenate) (None, 13, 13, 384) 0 activation_104[0][0]
activation_107[0][0]
__________________________________________________________________________________________________
block17_8_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_8_mixed[0][0]
__________________________________________________________________________________________________
block17_8 (Lambda) (None, 13, 13, 1088) 0 block17_7_ac[0][0]
block17_8_conv[0][0]
__________________________________________________________________________________________________
block17_8_ac (Activation) (None, 13, 13, 1088) 0 block17_8[0][0]
__________________________________________________________________________________________________
conv2d_109 (Conv2D) (None, 13, 13, 128) 139264 block17_8_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_109 (BatchN (None, 13, 13, 128) 384 conv2d_109[0][0]
__________________________________________________________________________________________________
activation_109 (Activation) (None, 13, 13, 128) 0 batch_normalization_109[0][0]
__________________________________________________________________________________________________
conv2d_110 (Conv2D) (None, 13, 13, 160) 143360 activation_109[0][0]
__________________________________________________________________________________________________
batch_normalization_110 (BatchN (None, 13, 13, 160) 480 conv2d_110[0][0]
__________________________________________________________________________________________________
activation_110 (Activation) (None, 13, 13, 160) 0 batch_normalization_110[0][0]
__________________________________________________________________________________________________
conv2d_108 (Conv2D) (None, 13, 13, 192) 208896 block17_8_ac[0][0]
__________________________________________________________________________________________________
conv2d_111 (Conv2D) (None, 13, 13, 192) 215040 activation_110[0][0]
__________________________________________________________________________________________________
batch_normalization_108 (BatchN (None, 13, 13, 192) 576 conv2d_108[0][0]
__________________________________________________________________________________________________
batch_normalization_111 (BatchN (None, 13, 13, 192) 576 conv2d_111[0][0]
__________________________________________________________________________________________________
activation_108 (Activation) (None, 13, 13, 192) 0 batch_normalization_108[0][0]
__________________________________________________________________________________________________
activation_111 (Activation) (None, 13, 13, 192) 0 batch_normalization_111[0][0]
__________________________________________________________________________________________________
block17_9_mixed (Concatenate) (None, 13, 13, 384) 0 activation_108[0][0]
activation_111[0][0]
__________________________________________________________________________________________________
block17_9_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_9_mixed[0][0]
__________________________________________________________________________________________________
block17_9 (Lambda) (None, 13, 13, 1088) 0 block17_8_ac[0][0]
block17_9_conv[0][0]
__________________________________________________________________________________________________
block17_9_ac (Activation) (None, 13, 13, 1088) 0 block17_9[0][0]
__________________________________________________________________________________________________
conv2d_113 (Conv2D) (None, 13, 13, 128) 139264 block17_9_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_113 (BatchN (None, 13, 13, 128) 384 conv2d_113[0][0]
__________________________________________________________________________________________________
activation_113 (Activation) (None, 13, 13, 128) 0 batch_normalization_113[0][0]
__________________________________________________________________________________________________
conv2d_114 (Conv2D) (None, 13, 13, 160) 143360 activation_113[0][0]
__________________________________________________________________________________________________
batch_normalization_114 (BatchN (None, 13, 13, 160) 480 conv2d_114[0][0]
__________________________________________________________________________________________________
activation_114 (Activation) (None, 13, 13, 160) 0 batch_normalization_114[0][0]
__________________________________________________________________________________________________
conv2d_112 (Conv2D) (None, 13, 13, 192) 208896 block17_9_ac[0][0]
__________________________________________________________________________________________________
conv2d_115 (Conv2D) (None, 13, 13, 192) 215040 activation_114[0][0]
__________________________________________________________________________________________________
batch_normalization_112 (BatchN (None, 13, 13, 192) 576 conv2d_112[0][0]
__________________________________________________________________________________________________
batch_normalization_115 (BatchN (None, 13, 13, 192) 576 conv2d_115[0][0]
__________________________________________________________________________________________________
activation_112 (Activation) (None, 13, 13, 192) 0 batch_normalization_112[0][0]
__________________________________________________________________________________________________
activation_115 (Activation) (None, 13, 13, 192) 0 batch_normalization_115[0][0]
__________________________________________________________________________________________________
block17_10_mixed (Concatenate) (None, 13, 13, 384) 0 activation_112[0][0]
activation_115[0][0]
__________________________________________________________________________________________________
block17_10_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_10_mixed[0][0]
__________________________________________________________________________________________________
block17_10 (Lambda) (None, 13, 13, 1088) 0 block17_9_ac[0][0]
block17_10_conv[0][0]
__________________________________________________________________________________________________
block17_10_ac (Activation) (None, 13, 13, 1088) 0 block17_10[0][0]
__________________________________________________________________________________________________
conv2d_117 (Conv2D) (None, 13, 13, 128) 139264 block17_10_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_117 (BatchN (None, 13, 13, 128) 384 conv2d_117[0][0]
__________________________________________________________________________________________________
activation_117 (Activation) (None, 13, 13, 128) 0 batch_normalization_117[0][0]
__________________________________________________________________________________________________
conv2d_118 (Conv2D) (None, 13, 13, 160) 143360 activation_117[0][0]
__________________________________________________________________________________________________
batch_normalization_118 (BatchN (None, 13, 13, 160) 480 conv2d_118[0][0]
__________________________________________________________________________________________________
activation_118 (Activation) (None, 13, 13, 160) 0 batch_normalization_118[0][0]
__________________________________________________________________________________________________
conv2d_116 (Conv2D) (None, 13, 13, 192) 208896 block17_10_ac[0][0]
__________________________________________________________________________________________________
conv2d_119 (Conv2D) (None, 13, 13, 192) 215040 activation_118[0][0]
__________________________________________________________________________________________________
batch_normalization_116 (BatchN (None, 13, 13, 192) 576 conv2d_116[0][0]
__________________________________________________________________________________________________
batch_normalization_119 (BatchN (None, 13, 13, 192) 576 conv2d_119[0][0]
__________________________________________________________________________________________________
activation_116 (Activation) (None, 13, 13, 192) 0 batch_normalization_116[0][0]
__________________________________________________________________________________________________
activation_119 (Activation) (None, 13, 13, 192) 0 batch_normalization_119[0][0]
__________________________________________________________________________________________________
block17_11_mixed (Concatenate) (None, 13, 13, 384) 0 activation_116[0][0]
activation_119[0][0]
__________________________________________________________________________________________________
block17_11_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_11_mixed[0][0]
__________________________________________________________________________________________________
block17_11 (Lambda) (None, 13, 13, 1088) 0 block17_10_ac[0][0]
block17_11_conv[0][0]
__________________________________________________________________________________________________
block17_11_ac (Activation) (None, 13, 13, 1088) 0 block17_11[0][0]
__________________________________________________________________________________________________
conv2d_121 (Conv2D) (None, 13, 13, 128) 139264 block17_11_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_121 (BatchN (None, 13, 13, 128) 384 conv2d_121[0][0]
__________________________________________________________________________________________________
activation_121 (Activation) (None, 13, 13, 128) 0 batch_normalization_121[0][0]
__________________________________________________________________________________________________
conv2d_122 (Conv2D) (None, 13, 13, 160) 143360 activation_121[0][0]
__________________________________________________________________________________________________
batch_normalization_122 (BatchN (None, 13, 13, 160) 480 conv2d_122[0][0]
__________________________________________________________________________________________________
activation_122 (Activation) (None, 13, 13, 160) 0 batch_normalization_122[0][0]
__________________________________________________________________________________________________
conv2d_120 (Conv2D) (None, 13, 13, 192) 208896 block17_11_ac[0][0]
__________________________________________________________________________________________________
conv2d_123 (Conv2D) (None, 13, 13, 192) 215040 activation_122[0][0]
__________________________________________________________________________________________________
batch_normalization_120 (BatchN (None, 13, 13, 192) 576 conv2d_120[0][0]
__________________________________________________________________________________________________
batch_normalization_123 (BatchN (None, 13, 13, 192) 576 conv2d_123[0][0]
__________________________________________________________________________________________________
activation_120 (Activation) (None, 13, 13, 192) 0 batch_normalization_120[0][0]
__________________________________________________________________________________________________
activation_123 (Activation) (None, 13, 13, 192) 0 batch_normalization_123[0][0]
__________________________________________________________________________________________________
block17_12_mixed (Concatenate) (None, 13, 13, 384) 0 activation_120[0][0]
activation_123[0][0]
__________________________________________________________________________________________________
block17_12_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_12_mixed[0][0]
__________________________________________________________________________________________________
block17_12 (Lambda) (None, 13, 13, 1088) 0 block17_11_ac[0][0]
block17_12_conv[0][0]
__________________________________________________________________________________________________
block17_12_ac (Activation) (None, 13, 13, 1088) 0 block17_12[0][0]
__________________________________________________________________________________________________
conv2d_125 (Conv2D) (None, 13, 13, 128) 139264 block17_12_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_125 (BatchN (None, 13, 13, 128) 384 conv2d_125[0][0]
__________________________________________________________________________________________________
activation_125 (Activation) (None, 13, 13, 128) 0 batch_normalization_125[0][0]
__________________________________________________________________________________________________
conv2d_126 (Conv2D) (None, 13, 13, 160) 143360 activation_125[0][0]
__________________________________________________________________________________________________
batch_normalization_126 (BatchN (None, 13, 13, 160) 480 conv2d_126[0][0]
__________________________________________________________________________________________________
activation_126 (Activation) (None, 13, 13, 160) 0 batch_normalization_126[0][0]
__________________________________________________________________________________________________
conv2d_124 (Conv2D) (None, 13, 13, 192) 208896 block17_12_ac[0][0]
__________________________________________________________________________________________________
conv2d_127 (Conv2D) (None, 13, 13, 192) 215040 activation_126[0][0]
__________________________________________________________________________________________________
batch_normalization_124 (BatchN (None, 13, 13, 192) 576 conv2d_124[0][0]
__________________________________________________________________________________________________
batch_normalization_127 (BatchN (None, 13, 13, 192) 576 conv2d_127[0][0]
__________________________________________________________________________________________________
activation_124 (Activation) (None, 13, 13, 192) 0 batch_normalization_124[0][0]
__________________________________________________________________________________________________
activation_127 (Activation) (None, 13, 13, 192) 0 batch_normalization_127[0][0]
__________________________________________________________________________________________________
block17_13_mixed (Concatenate) (None, 13, 13, 384) 0 activation_124[0][0]
activation_127[0][0]
__________________________________________________________________________________________________
block17_13_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_13_mixed[0][0]
__________________________________________________________________________________________________
block17_13 (Lambda) (None, 13, 13, 1088) 0 block17_12_ac[0][0]
block17_13_conv[0][0]
__________________________________________________________________________________________________
block17_13_ac (Activation) (None, 13, 13, 1088) 0 block17_13[0][0]
__________________________________________________________________________________________________
conv2d_129 (Conv2D) (None, 13, 13, 128) 139264 block17_13_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_129 (BatchN (None, 13, 13, 128) 384 conv2d_129[0][0]
__________________________________________________________________________________________________
activation_129 (Activation) (None, 13, 13, 128) 0 batch_normalization_129[0][0]
__________________________________________________________________________________________________
conv2d_130 (Conv2D) (None, 13, 13, 160) 143360 activation_129[0][0]
__________________________________________________________________________________________________
batch_normalization_130 (BatchN (None, 13, 13, 160) 480 conv2d_130[0][0]
__________________________________________________________________________________________________
activation_130 (Activation) (None, 13, 13, 160) 0 batch_normalization_130[0][0]
__________________________________________________________________________________________________
conv2d_128 (Conv2D) (None, 13, 13, 192) 208896 block17_13_ac[0][0]
__________________________________________________________________________________________________
conv2d_131 (Conv2D) (None, 13, 13, 192) 215040 activation_130[0][0]
__________________________________________________________________________________________________
batch_normalization_128 (BatchN (None, 13, 13, 192) 576 conv2d_128[0][0]
__________________________________________________________________________________________________
batch_normalization_131 (BatchN (None, 13, 13, 192) 576 conv2d_131[0][0]
__________________________________________________________________________________________________
activation_128 (Activation) (None, 13, 13, 192) 0 batch_normalization_128[0][0]
__________________________________________________________________________________________________
activation_131 (Activation) (None, 13, 13, 192) 0 batch_normalization_131[0][0]
__________________________________________________________________________________________________
block17_14_mixed (Concatenate) (None, 13, 13, 384) 0 activation_128[0][0]
activation_131[0][0]
__________________________________________________________________________________________________
block17_14_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_14_mixed[0][0]
__________________________________________________________________________________________________
block17_14 (Lambda) (None, 13, 13, 1088) 0 block17_13_ac[0][0]
block17_14_conv[0][0]
__________________________________________________________________________________________________
block17_14_ac (Activation) (None, 13, 13, 1088) 0 block17_14[0][0]
__________________________________________________________________________________________________
conv2d_133 (Conv2D) (None, 13, 13, 128) 139264 block17_14_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_133 (BatchN (None, 13, 13, 128) 384 conv2d_133[0][0]
__________________________________________________________________________________________________
activation_133 (Activation) (None, 13, 13, 128) 0 batch_normalization_133[0][0]
__________________________________________________________________________________________________
conv2d_134 (Conv2D) (None, 13, 13, 160) 143360 activation_133[0][0]
__________________________________________________________________________________________________
batch_normalization_134 (BatchN (None, 13, 13, 160) 480 conv2d_134[0][0]
__________________________________________________________________________________________________
activation_134 (Activation) (None, 13, 13, 160) 0 batch_normalization_134[0][0]
__________________________________________________________________________________________________
conv2d_132 (Conv2D) (None, 13, 13, 192) 208896 block17_14_ac[0][0]
__________________________________________________________________________________________________
conv2d_135 (Conv2D) (None, 13, 13, 192) 215040 activation_134[0][0]
__________________________________________________________________________________________________
batch_normalization_132 (BatchN (None, 13, 13, 192) 576 conv2d_132[0][0]
__________________________________________________________________________________________________
batch_normalization_135 (BatchN (None, 13, 13, 192) 576 conv2d_135[0][0]
__________________________________________________________________________________________________
activation_132 (Activation) (None, 13, 13, 192) 0 batch_normalization_132[0][0]
__________________________________________________________________________________________________
activation_135 (Activation) (None, 13, 13, 192) 0 batch_normalization_135[0][0]
__________________________________________________________________________________________________
block17_15_mixed (Concatenate) (None, 13, 13, 384) 0 activation_132[0][0]
activation_135[0][0]
__________________________________________________________________________________________________
block17_15_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_15_mixed[0][0]
__________________________________________________________________________________________________
block17_15 (Lambda) (None, 13, 13, 1088) 0 block17_14_ac[0][0]
block17_15_conv[0][0]
__________________________________________________________________________________________________
block17_15_ac (Activation) (None, 13, 13, 1088) 0 block17_15[0][0]
__________________________________________________________________________________________________
conv2d_137 (Conv2D) (None, 13, 13, 128) 139264 block17_15_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_137 (BatchN (None, 13, 13, 128) 384 conv2d_137[0][0]
__________________________________________________________________________________________________
activation_137 (Activation) (None, 13, 13, 128) 0 batch_normalization_137[0][0]
__________________________________________________________________________________________________
conv2d_138 (Conv2D) (None, 13, 13, 160) 143360 activation_137[0][0]
__________________________________________________________________________________________________
batch_normalization_138 (BatchN (None, 13, 13, 160) 480 conv2d_138[0][0]
__________________________________________________________________________________________________
activation_138 (Activation) (None, 13, 13, 160) 0 batch_normalization_138[0][0]
__________________________________________________________________________________________________
conv2d_136 (Conv2D) (None, 13, 13, 192) 208896 block17_15_ac[0][0]
__________________________________________________________________________________________________
conv2d_139 (Conv2D) (None, 13, 13, 192) 215040 activation_138[0][0]
__________________________________________________________________________________________________
batch_normalization_136 (BatchN (None, 13, 13, 192) 576 conv2d_136[0][0]
__________________________________________________________________________________________________
batch_normalization_139 (BatchN (None, 13, 13, 192) 576 conv2d_139[0][0]
__________________________________________________________________________________________________
activation_136 (Activation) (None, 13, 13, 192) 0 batch_normalization_136[0][0]
__________________________________________________________________________________________________
activation_139 (Activation) (None, 13, 13, 192) 0 batch_normalization_139[0][0]
__________________________________________________________________________________________________
block17_16_mixed (Concatenate) (None, 13, 13, 384) 0 activation_136[0][0]
activation_139[0][0]
__________________________________________________________________________________________________
block17_16_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_16_mixed[0][0]
__________________________________________________________________________________________________
block17_16 (Lambda) (None, 13, 13, 1088) 0 block17_15_ac[0][0]
block17_16_conv[0][0]
__________________________________________________________________________________________________
block17_16_ac (Activation) (None, 13, 13, 1088) 0 block17_16[0][0]
__________________________________________________________________________________________________
conv2d_141 (Conv2D) (None, 13, 13, 128) 139264 block17_16_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_141 (BatchN (None, 13, 13, 128) 384 conv2d_141[0][0]
__________________________________________________________________________________________________
activation_141 (Activation) (None, 13, 13, 128) 0 batch_normalization_141[0][0]
__________________________________________________________________________________________________
conv2d_142 (Conv2D) (None, 13, 13, 160) 143360 activation_141[0][0]
__________________________________________________________________________________________________
batch_normalization_142 (BatchN (None, 13, 13, 160) 480 conv2d_142[0][0]
__________________________________________________________________________________________________
activation_142 (Activation) (None, 13, 13, 160) 0 batch_normalization_142[0][0]
__________________________________________________________________________________________________
conv2d_140 (Conv2D) (None, 13, 13, 192) 208896 block17_16_ac[0][0]
__________________________________________________________________________________________________
conv2d_143 (Conv2D) (None, 13, 13, 192) 215040 activation_142[0][0]
__________________________________________________________________________________________________
batch_normalization_140 (BatchN (None, 13, 13, 192) 576 conv2d_140[0][0]
__________________________________________________________________________________________________
batch_normalization_143 (BatchN (None, 13, 13, 192) 576 conv2d_143[0][0]
__________________________________________________________________________________________________
activation_140 (Activation) (None, 13, 13, 192) 0 batch_normalization_140[0][0]
__________________________________________________________________________________________________
activation_143 (Activation) (None, 13, 13, 192) 0 batch_normalization_143[0][0]
__________________________________________________________________________________________________
block17_17_mixed (Concatenate) (None, 13, 13, 384) 0 activation_140[0][0]
activation_143[0][0]
__________________________________________________________________________________________________
block17_17_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_17_mixed[0][0]
__________________________________________________________________________________________________
block17_17 (Lambda) (None, 13, 13, 1088) 0 block17_16_ac[0][0]
block17_17_conv[0][0]
__________________________________________________________________________________________________
block17_17_ac (Activation) (None, 13, 13, 1088) 0 block17_17[0][0]
__________________________________________________________________________________________________
conv2d_145 (Conv2D) (None, 13, 13, 128) 139264 block17_17_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_145 (BatchN (None, 13, 13, 128) 384 conv2d_145[0][0]
__________________________________________________________________________________________________
activation_145 (Activation) (None, 13, 13, 128) 0 batch_normalization_145[0][0]
__________________________________________________________________________________________________
conv2d_146 (Conv2D) (None, 13, 13, 160) 143360 activation_145[0][0]
__________________________________________________________________________________________________
batch_normalization_146 (BatchN (None, 13, 13, 160) 480 conv2d_146[0][0]
__________________________________________________________________________________________________
activation_146 (Activation) (None, 13, 13, 160) 0 batch_normalization_146[0][0]
__________________________________________________________________________________________________
conv2d_144 (Conv2D) (None, 13, 13, 192) 208896 block17_17_ac[0][0]
__________________________________________________________________________________________________
conv2d_147 (Conv2D) (None, 13, 13, 192) 215040 activation_146[0][0]
__________________________________________________________________________________________________
batch_normalization_144 (BatchN (None, 13, 13, 192) 576 conv2d_144[0][0]
__________________________________________________________________________________________________
batch_normalization_147 (BatchN (None, 13, 13, 192) 576 conv2d_147[0][0]
__________________________________________________________________________________________________
activation_144 (Activation) (None, 13, 13, 192) 0 batch_normalization_144[0][0]
__________________________________________________________________________________________________
activation_147 (Activation) (None, 13, 13, 192) 0 batch_normalization_147[0][0]
__________________________________________________________________________________________________
block17_18_mixed (Concatenate) (None, 13, 13, 384) 0 activation_144[0][0]
activation_147[0][0]
__________________________________________________________________________________________________
block17_18_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_18_mixed[0][0]
__________________________________________________________________________________________________
block17_18 (Lambda) (None, 13, 13, 1088) 0 block17_17_ac[0][0]
block17_18_conv[0][0]
__________________________________________________________________________________________________
block17_18_ac (Activation) (None, 13, 13, 1088) 0 block17_18[0][0]
__________________________________________________________________________________________________
conv2d_149 (Conv2D) (None, 13, 13, 128) 139264 block17_18_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_149 (BatchN (None, 13, 13, 128) 384 conv2d_149[0][0]
__________________________________________________________________________________________________
activation_149 (Activation) (None, 13, 13, 128) 0 batch_normalization_149[0][0]
__________________________________________________________________________________________________
conv2d_150 (Conv2D) (None, 13, 13, 160) 143360 activation_149[0][0]
__________________________________________________________________________________________________
batch_normalization_150 (BatchN (None, 13, 13, 160) 480 conv2d_150[0][0]
__________________________________________________________________________________________________
activation_150 (Activation) (None, 13, 13, 160) 0 batch_normalization_150[0][0]
__________________________________________________________________________________________________
conv2d_148 (Conv2D) (None, 13, 13, 192) 208896 block17_18_ac[0][0]
__________________________________________________________________________________________________
conv2d_151 (Conv2D) (None, 13, 13, 192) 215040 activation_150[0][0]
__________________________________________________________________________________________________
batch_normalization_148 (BatchN (None, 13, 13, 192) 576 conv2d_148[0][0]
__________________________________________________________________________________________________
batch_normalization_151 (BatchN (None, 13, 13, 192) 576 conv2d_151[0][0]
__________________________________________________________________________________________________
activation_148 (Activation) (None, 13, 13, 192) 0 batch_normalization_148[0][0]
__________________________________________________________________________________________________
activation_151 (Activation) (None, 13, 13, 192) 0 batch_normalization_151[0][0]
__________________________________________________________________________________________________
block17_19_mixed (Concatenate) (None, 13, 13, 384) 0 activation_148[0][0]
activation_151[0][0]
__________________________________________________________________________________________________
block17_19_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_19_mixed[0][0]
__________________________________________________________________________________________________
block17_19 (Lambda) (None, 13, 13, 1088) 0 block17_18_ac[0][0]
block17_19_conv[0][0]
__________________________________________________________________________________________________
block17_19_ac (Activation) (None, 13, 13, 1088) 0 block17_19[0][0]
__________________________________________________________________________________________________
conv2d_153 (Conv2D) (None, 13, 13, 128) 139264 block17_19_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_153 (BatchN (None, 13, 13, 128) 384 conv2d_153[0][0]
__________________________________________________________________________________________________
activation_153 (Activation) (None, 13, 13, 128) 0 batch_normalization_153[0][0]
__________________________________________________________________________________________________
conv2d_154 (Conv2D) (None, 13, 13, 160) 143360 activation_153[0][0]
__________________________________________________________________________________________________
batch_normalization_154 (BatchN (None, 13, 13, 160) 480 conv2d_154[0][0]
__________________________________________________________________________________________________
activation_154 (Activation) (None, 13, 13, 160) 0 batch_normalization_154[0][0]
__________________________________________________________________________________________________
conv2d_152 (Conv2D) (None, 13, 13, 192) 208896 block17_19_ac[0][0]
__________________________________________________________________________________________________
conv2d_155 (Conv2D) (None, 13, 13, 192) 215040 activation_154[0][0]
__________________________________________________________________________________________________
batch_normalization_152 (BatchN (None, 13, 13, 192) 576 conv2d_152[0][0]
__________________________________________________________________________________________________
batch_normalization_155 (BatchN (None, 13, 13, 192) 576 conv2d_155[0][0]
__________________________________________________________________________________________________
activation_152 (Activation) (None, 13, 13, 192) 0 batch_normalization_152[0][0]
__________________________________________________________________________________________________
activation_155 (Activation) (None, 13, 13, 192) 0 batch_normalization_155[0][0]
__________________________________________________________________________________________________
block17_20_mixed (Concatenate) (None, 13, 13, 384) 0 activation_152[0][0]
activation_155[0][0]
__________________________________________________________________________________________________
block17_20_conv (Conv2D) (None, 13, 13, 1088) 418880 block17_20_mixed[0][0]
__________________________________________________________________________________________________
block17_20 (Lambda) (None, 13, 13, 1088) 0 block17_19_ac[0][0]
block17_20_conv[0][0]
__________________________________________________________________________________________________
block17_20_ac (Activation) (None, 13, 13, 1088) 0 block17_20[0][0]
__________________________________________________________________________________________________
conv2d_160 (Conv2D) (None, 13, 13, 256) 278528 block17_20_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_160 (BatchN (None, 13, 13, 256) 768 conv2d_160[0][0]
__________________________________________________________________________________________________
activation_160 (Activation) (None, 13, 13, 256) 0 batch_normalization_160[0][0]
__________________________________________________________________________________________________
conv2d_156 (Conv2D) (None, 13, 13, 256) 278528 block17_20_ac[0][0]
__________________________________________________________________________________________________
conv2d_158 (Conv2D) (None, 13, 13, 256) 278528 block17_20_ac[0][0]
__________________________________________________________________________________________________
conv2d_161 (Conv2D) (None, 13, 13, 288) 663552 activation_160[0][0]
__________________________________________________________________________________________________
batch_normalization_156 (BatchN (None, 13, 13, 256) 768 conv2d_156[0][0]
__________________________________________________________________________________________________
batch_normalization_158 (BatchN (None, 13, 13, 256) 768 conv2d_158[0][0]
__________________________________________________________________________________________________
batch_normalization_161 (BatchN (None, 13, 13, 288) 864 conv2d_161[0][0]
__________________________________________________________________________________________________
activation_156 (Activation) (None, 13, 13, 256) 0 batch_normalization_156[0][0]
__________________________________________________________________________________________________
activation_158 (Activation) (None, 13, 13, 256) 0 batch_normalization_158[0][0]
__________________________________________________________________________________________________
activation_161 (Activation) (None, 13, 13, 288) 0 batch_normalization_161[0][0]
__________________________________________________________________________________________________
conv2d_157 (Conv2D) (None, 6, 6, 384) 884736 activation_156[0][0]
__________________________________________________________________________________________________
conv2d_159 (Conv2D) (None, 6, 6, 288) 663552 activation_158[0][0]
__________________________________________________________________________________________________
conv2d_162 (Conv2D) (None, 6, 6, 320) 829440 activation_161[0][0]
__________________________________________________________________________________________________
batch_normalization_157 (BatchN (None, 6, 6, 384) 1152 conv2d_157[0][0]
__________________________________________________________________________________________________
batch_normalization_159 (BatchN (None, 6, 6, 288) 864 conv2d_159[0][0]
__________________________________________________________________________________________________
batch_normalization_162 (BatchN (None, 6, 6, 320) 960 conv2d_162[0][0]
__________________________________________________________________________________________________
activation_157 (Activation) (None, 6, 6, 384) 0 batch_normalization_157[0][0]
__________________________________________________________________________________________________
activation_159 (Activation) (None, 6, 6, 288) 0 batch_normalization_159[0][0]
__________________________________________________________________________________________________
activation_162 (Activation) (None, 6, 6, 320) 0 batch_normalization_162[0][0]
__________________________________________________________________________________________________
max_pooling2d_3 (MaxPooling2D) (None, 6, 6, 1088) 0 block17_20_ac[0][0]
__________________________________________________________________________________________________
mixed_7a (Concatenate) (None, 6, 6, 2080) 0 activation_157[0][0]
activation_159[0][0]
activation_162[0][0]
max_pooling2d_3[0][0]
__________________________________________________________________________________________________
conv2d_164 (Conv2D) (None, 6, 6, 192) 399360 mixed_7a[0][0]
__________________________________________________________________________________________________
batch_normalization_164 (BatchN (None, 6, 6, 192) 576 conv2d_164[0][0]
__________________________________________________________________________________________________
activation_164 (Activation) (None, 6, 6, 192) 0 batch_normalization_164[0][0]
__________________________________________________________________________________________________
conv2d_165 (Conv2D) (None, 6, 6, 224) 129024 activation_164[0][0]
__________________________________________________________________________________________________
batch_normalization_165 (BatchN (None, 6, 6, 224) 672 conv2d_165[0][0]
__________________________________________________________________________________________________
activation_165 (Activation) (None, 6, 6, 224) 0 batch_normalization_165[0][0]
__________________________________________________________________________________________________
conv2d_163 (Conv2D) (None, 6, 6, 192) 399360 mixed_7a[0][0]
__________________________________________________________________________________________________
conv2d_166 (Conv2D) (None, 6, 6, 256) 172032 activation_165[0][0]
__________________________________________________________________________________________________
batch_normalization_163 (BatchN (None, 6, 6, 192) 576 conv2d_163[0][0]
__________________________________________________________________________________________________
batch_normalization_166 (BatchN (None, 6, 6, 256) 768 conv2d_166[0][0]
__________________________________________________________________________________________________
activation_163 (Activation) (None, 6, 6, 192) 0 batch_normalization_163[0][0]
__________________________________________________________________________________________________
activation_166 (Activation) (None, 6, 6, 256) 0 batch_normalization_166[0][0]
__________________________________________________________________________________________________
block8_1_mixed (Concatenate) (None, 6, 6, 448) 0 activation_163[0][0]
activation_166[0][0]
__________________________________________________________________________________________________
block8_1_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_1_mixed[0][0]
__________________________________________________________________________________________________
block8_1 (Lambda) (None, 6, 6, 2080) 0 mixed_7a[0][0]
block8_1_conv[0][0]
__________________________________________________________________________________________________
block8_1_ac (Activation) (None, 6, 6, 2080) 0 block8_1[0][0]
__________________________________________________________________________________________________
conv2d_168 (Conv2D) (None, 6, 6, 192) 399360 block8_1_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_168 (BatchN (None, 6, 6, 192) 576 conv2d_168[0][0]
__________________________________________________________________________________________________
activation_168 (Activation) (None, 6, 6, 192) 0 batch_normalization_168[0][0]
__________________________________________________________________________________________________
conv2d_169 (Conv2D) (None, 6, 6, 224) 129024 activation_168[0][0]
__________________________________________________________________________________________________
batch_normalization_169 (BatchN (None, 6, 6, 224) 672 conv2d_169[0][0]
__________________________________________________________________________________________________
activation_169 (Activation) (None, 6, 6, 224) 0 batch_normalization_169[0][0]
__________________________________________________________________________________________________
conv2d_167 (Conv2D) (None, 6, 6, 192) 399360 block8_1_ac[0][0]
__________________________________________________________________________________________________
conv2d_170 (Conv2D) (None, 6, 6, 256) 172032 activation_169[0][0]
__________________________________________________________________________________________________
batch_normalization_167 (BatchN (None, 6, 6, 192) 576 conv2d_167[0][0]
__________________________________________________________________________________________________
batch_normalization_170 (BatchN (None, 6, 6, 256) 768 conv2d_170[0][0]
__________________________________________________________________________________________________
activation_167 (Activation) (None, 6, 6, 192) 0 batch_normalization_167[0][0]
__________________________________________________________________________________________________
activation_170 (Activation) (None, 6, 6, 256) 0 batch_normalization_170[0][0]
__________________________________________________________________________________________________
block8_2_mixed (Concatenate) (None, 6, 6, 448) 0 activation_167[0][0]
activation_170[0][0]
__________________________________________________________________________________________________
block8_2_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_2_mixed[0][0]
__________________________________________________________________________________________________
block8_2 (Lambda) (None, 6, 6, 2080) 0 block8_1_ac[0][0]
block8_2_conv[0][0]
__________________________________________________________________________________________________
block8_2_ac (Activation) (None, 6, 6, 2080) 0 block8_2[0][0]
__________________________________________________________________________________________________
conv2d_172 (Conv2D) (None, 6, 6, 192) 399360 block8_2_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_172 (BatchN (None, 6, 6, 192) 576 conv2d_172[0][0]
__________________________________________________________________________________________________
activation_172 (Activation) (None, 6, 6, 192) 0 batch_normalization_172[0][0]
__________________________________________________________________________________________________
conv2d_173 (Conv2D) (None, 6, 6, 224) 129024 activation_172[0][0]
__________________________________________________________________________________________________
batch_normalization_173 (BatchN (None, 6, 6, 224) 672 conv2d_173[0][0]
__________________________________________________________________________________________________
activation_173 (Activation) (None, 6, 6, 224) 0 batch_normalization_173[0][0]
__________________________________________________________________________________________________
conv2d_171 (Conv2D) (None, 6, 6, 192) 399360 block8_2_ac[0][0]
__________________________________________________________________________________________________
conv2d_174 (Conv2D) (None, 6, 6, 256) 172032 activation_173[0][0]
__________________________________________________________________________________________________
batch_normalization_171 (BatchN (None, 6, 6, 192) 576 conv2d_171[0][0]
__________________________________________________________________________________________________
batch_normalization_174 (BatchN (None, 6, 6, 256) 768 conv2d_174[0][0]
__________________________________________________________________________________________________
activation_171 (Activation) (None, 6, 6, 192) 0 batch_normalization_171[0][0]
__________________________________________________________________________________________________
activation_174 (Activation) (None, 6, 6, 256) 0 batch_normalization_174[0][0]
__________________________________________________________________________________________________
block8_3_mixed (Concatenate) (None, 6, 6, 448) 0 activation_171[0][0]
activation_174[0][0]
__________________________________________________________________________________________________
block8_3_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_3_mixed[0][0]
__________________________________________________________________________________________________
block8_3 (Lambda) (None, 6, 6, 2080) 0 block8_2_ac[0][0]
block8_3_conv[0][0]
__________________________________________________________________________________________________
block8_3_ac (Activation) (None, 6, 6, 2080) 0 block8_3[0][0]
__________________________________________________________________________________________________
conv2d_176 (Conv2D) (None, 6, 6, 192) 399360 block8_3_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_176 (BatchN (None, 6, 6, 192) 576 conv2d_176[0][0]
__________________________________________________________________________________________________
activation_176 (Activation) (None, 6, 6, 192) 0 batch_normalization_176[0][0]
__________________________________________________________________________________________________
conv2d_177 (Conv2D) (None, 6, 6, 224) 129024 activation_176[0][0]
__________________________________________________________________________________________________
batch_normalization_177 (BatchN (None, 6, 6, 224) 672 conv2d_177[0][0]
__________________________________________________________________________________________________
activation_177 (Activation) (None, 6, 6, 224) 0 batch_normalization_177[0][0]
__________________________________________________________________________________________________
conv2d_175 (Conv2D) (None, 6, 6, 192) 399360 block8_3_ac[0][0]
__________________________________________________________________________________________________
conv2d_178 (Conv2D) (None, 6, 6, 256) 172032 activation_177[0][0]
__________________________________________________________________________________________________
batch_normalization_175 (BatchN (None, 6, 6, 192) 576 conv2d_175[0][0]
__________________________________________________________________________________________________
batch_normalization_178 (BatchN (None, 6, 6, 256) 768 conv2d_178[0][0]
__________________________________________________________________________________________________
activation_175 (Activation) (None, 6, 6, 192) 0 batch_normalization_175[0][0]
__________________________________________________________________________________________________
activation_178 (Activation) (None, 6, 6, 256) 0 batch_normalization_178[0][0]
__________________________________________________________________________________________________
block8_4_mixed (Concatenate) (None, 6, 6, 448) 0 activation_175[0][0]
activation_178[0][0]
__________________________________________________________________________________________________
block8_4_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_4_mixed[0][0]
__________________________________________________________________________________________________
block8_4 (Lambda) (None, 6, 6, 2080) 0 block8_3_ac[0][0]
block8_4_conv[0][0]
__________________________________________________________________________________________________
block8_4_ac (Activation) (None, 6, 6, 2080) 0 block8_4[0][0]
__________________________________________________________________________________________________
conv2d_180 (Conv2D) (None, 6, 6, 192) 399360 block8_4_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_180 (BatchN (None, 6, 6, 192) 576 conv2d_180[0][0]
__________________________________________________________________________________________________
activation_180 (Activation) (None, 6, 6, 192) 0 batch_normalization_180[0][0]
__________________________________________________________________________________________________
conv2d_181 (Conv2D) (None, 6, 6, 224) 129024 activation_180[0][0]
__________________________________________________________________________________________________
batch_normalization_181 (BatchN (None, 6, 6, 224) 672 conv2d_181[0][0]
__________________________________________________________________________________________________
activation_181 (Activation) (None, 6, 6, 224) 0 batch_normalization_181[0][0]
__________________________________________________________________________________________________
conv2d_179 (Conv2D) (None, 6, 6, 192) 399360 block8_4_ac[0][0]
__________________________________________________________________________________________________
conv2d_182 (Conv2D) (None, 6, 6, 256) 172032 activation_181[0][0]
__________________________________________________________________________________________________
batch_normalization_179 (BatchN (None, 6, 6, 192) 576 conv2d_179[0][0]
__________________________________________________________________________________________________
batch_normalization_182 (BatchN (None, 6, 6, 256) 768 conv2d_182[0][0]
__________________________________________________________________________________________________
activation_179 (Activation) (None, 6, 6, 192) 0 batch_normalization_179[0][0]
__________________________________________________________________________________________________
activation_182 (Activation) (None, 6, 6, 256) 0 batch_normalization_182[0][0]
__________________________________________________________________________________________________
block8_5_mixed (Concatenate) (None, 6, 6, 448) 0 activation_179[0][0]
activation_182[0][0]
__________________________________________________________________________________________________
block8_5_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_5_mixed[0][0]
__________________________________________________________________________________________________
block8_5 (Lambda) (None, 6, 6, 2080) 0 block8_4_ac[0][0]
block8_5_conv[0][0]
__________________________________________________________________________________________________
block8_5_ac (Activation) (None, 6, 6, 2080) 0 block8_5[0][0]
__________________________________________________________________________________________________
conv2d_184 (Conv2D) (None, 6, 6, 192) 399360 block8_5_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_184 (BatchN (None, 6, 6, 192) 576 conv2d_184[0][0]
__________________________________________________________________________________________________
activation_184 (Activation) (None, 6, 6, 192) 0 batch_normalization_184[0][0]
__________________________________________________________________________________________________
conv2d_185 (Conv2D) (None, 6, 6, 224) 129024 activation_184[0][0]
__________________________________________________________________________________________________
batch_normalization_185 (BatchN (None, 6, 6, 224) 672 conv2d_185[0][0]
__________________________________________________________________________________________________
activation_185 (Activation) (None, 6, 6, 224) 0 batch_normalization_185[0][0]
__________________________________________________________________________________________________
conv2d_183 (Conv2D) (None, 6, 6, 192) 399360 block8_5_ac[0][0]
__________________________________________________________________________________________________
conv2d_186 (Conv2D) (None, 6, 6, 256) 172032 activation_185[0][0]
__________________________________________________________________________________________________
batch_normalization_183 (BatchN (None, 6, 6, 192) 576 conv2d_183[0][0]
__________________________________________________________________________________________________
batch_normalization_186 (BatchN (None, 6, 6, 256) 768 conv2d_186[0][0]
__________________________________________________________________________________________________
activation_183 (Activation) (None, 6, 6, 192) 0 batch_normalization_183[0][0]
__________________________________________________________________________________________________
activation_186 (Activation) (None, 6, 6, 256) 0 batch_normalization_186[0][0]
__________________________________________________________________________________________________
block8_6_mixed (Concatenate) (None, 6, 6, 448) 0 activation_183[0][0]
activation_186[0][0]
__________________________________________________________________________________________________
block8_6_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_6_mixed[0][0]
__________________________________________________________________________________________________
block8_6 (Lambda) (None, 6, 6, 2080) 0 block8_5_ac[0][0]
block8_6_conv[0][0]
__________________________________________________________________________________________________
block8_6_ac (Activation) (None, 6, 6, 2080) 0 block8_6[0][0]
__________________________________________________________________________________________________
conv2d_188 (Conv2D) (None, 6, 6, 192) 399360 block8_6_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_188 (BatchN (None, 6, 6, 192) 576 conv2d_188[0][0]
__________________________________________________________________________________________________
activation_188 (Activation) (None, 6, 6, 192) 0 batch_normalization_188[0][0]
__________________________________________________________________________________________________
conv2d_189 (Conv2D) (None, 6, 6, 224) 129024 activation_188[0][0]
__________________________________________________________________________________________________
batch_normalization_189 (BatchN (None, 6, 6, 224) 672 conv2d_189[0][0]
__________________________________________________________________________________________________
activation_189 (Activation) (None, 6, 6, 224) 0 batch_normalization_189[0][0]
__________________________________________________________________________________________________
conv2d_187 (Conv2D) (None, 6, 6, 192) 399360 block8_6_ac[0][0]
__________________________________________________________________________________________________
conv2d_190 (Conv2D) (None, 6, 6, 256) 172032 activation_189[0][0]
__________________________________________________________________________________________________
batch_normalization_187 (BatchN (None, 6, 6, 192) 576 conv2d_187[0][0]
__________________________________________________________________________________________________
batch_normalization_190 (BatchN (None, 6, 6, 256) 768 conv2d_190[0][0]
__________________________________________________________________________________________________
activation_187 (Activation) (None, 6, 6, 192) 0 batch_normalization_187[0][0]
__________________________________________________________________________________________________
activation_190 (Activation) (None, 6, 6, 256) 0 batch_normalization_190[0][0]
__________________________________________________________________________________________________
block8_7_mixed (Concatenate) (None, 6, 6, 448) 0 activation_187[0][0]
activation_190[0][0]
__________________________________________________________________________________________________
block8_7_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_7_mixed[0][0]
__________________________________________________________________________________________________
block8_7 (Lambda) (None, 6, 6, 2080) 0 block8_6_ac[0][0]
block8_7_conv[0][0]
__________________________________________________________________________________________________
block8_7_ac (Activation) (None, 6, 6, 2080) 0 block8_7[0][0]
__________________________________________________________________________________________________
conv2d_192 (Conv2D) (None, 6, 6, 192) 399360 block8_7_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_192 (BatchN (None, 6, 6, 192) 576 conv2d_192[0][0]
__________________________________________________________________________________________________
activation_192 (Activation) (None, 6, 6, 192) 0 batch_normalization_192[0][0]
__________________________________________________________________________________________________
conv2d_193 (Conv2D) (None, 6, 6, 224) 129024 activation_192[0][0]
__________________________________________________________________________________________________
batch_normalization_193 (BatchN (None, 6, 6, 224) 672 conv2d_193[0][0]
__________________________________________________________________________________________________
activation_193 (Activation) (None, 6, 6, 224) 0 batch_normalization_193[0][0]
__________________________________________________________________________________________________
conv2d_191 (Conv2D) (None, 6, 6, 192) 399360 block8_7_ac[0][0]
__________________________________________________________________________________________________
conv2d_194 (Conv2D) (None, 6, 6, 256) 172032 activation_193[0][0]
__________________________________________________________________________________________________
batch_normalization_191 (BatchN (None, 6, 6, 192) 576 conv2d_191[0][0]
__________________________________________________________________________________________________
batch_normalization_194 (BatchN (None, 6, 6, 256) 768 conv2d_194[0][0]
__________________________________________________________________________________________________
activation_191 (Activation) (None, 6, 6, 192) 0 batch_normalization_191[0][0]
__________________________________________________________________________________________________
activation_194 (Activation) (None, 6, 6, 256) 0 batch_normalization_194[0][0]
__________________________________________________________________________________________________
block8_8_mixed (Concatenate) (None, 6, 6, 448) 0 activation_191[0][0]
activation_194[0][0]
__________________________________________________________________________________________________
block8_8_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_8_mixed[0][0]
__________________________________________________________________________________________________
block8_8 (Lambda) (None, 6, 6, 2080) 0 block8_7_ac[0][0]
block8_8_conv[0][0]
__________________________________________________________________________________________________
block8_8_ac (Activation) (None, 6, 6, 2080) 0 block8_8[0][0]
__________________________________________________________________________________________________
conv2d_196 (Conv2D) (None, 6, 6, 192) 399360 block8_8_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_196 (BatchN (None, 6, 6, 192) 576 conv2d_196[0][0]
__________________________________________________________________________________________________
activation_196 (Activation) (None, 6, 6, 192) 0 batch_normalization_196[0][0]
__________________________________________________________________________________________________
conv2d_197 (Conv2D) (None, 6, 6, 224) 129024 activation_196[0][0]
__________________________________________________________________________________________________
batch_normalization_197 (BatchN (None, 6, 6, 224) 672 conv2d_197[0][0]
__________________________________________________________________________________________________
activation_197 (Activation) (None, 6, 6, 224) 0 batch_normalization_197[0][0]
__________________________________________________________________________________________________
conv2d_195 (Conv2D) (None, 6, 6, 192) 399360 block8_8_ac[0][0]
__________________________________________________________________________________________________
conv2d_198 (Conv2D) (None, 6, 6, 256) 172032 activation_197[0][0]
__________________________________________________________________________________________________
batch_normalization_195 (BatchN (None, 6, 6, 192) 576 conv2d_195[0][0]
__________________________________________________________________________________________________
batch_normalization_198 (BatchN (None, 6, 6, 256) 768 conv2d_198[0][0]
__________________________________________________________________________________________________
activation_195 (Activation) (None, 6, 6, 192) 0 batch_normalization_195[0][0]
__________________________________________________________________________________________________
activation_198 (Activation) (None, 6, 6, 256) 0 batch_normalization_198[0][0]
__________________________________________________________________________________________________
block8_9_mixed (Concatenate) (None, 6, 6, 448) 0 activation_195[0][0]
activation_198[0][0]
__________________________________________________________________________________________________
block8_9_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_9_mixed[0][0]
__________________________________________________________________________________________________
block8_9 (Lambda) (None, 6, 6, 2080) 0 block8_8_ac[0][0]
block8_9_conv[0][0]
__________________________________________________________________________________________________
block8_9_ac (Activation) (None, 6, 6, 2080) 0 block8_9[0][0]
__________________________________________________________________________________________________
conv2d_200 (Conv2D) (None, 6, 6, 192) 399360 block8_9_ac[0][0]
__________________________________________________________________________________________________
batch_normalization_200 (BatchN (None, 6, 6, 192) 576 conv2d_200[0][0]
__________________________________________________________________________________________________
activation_200 (Activation) (None, 6, 6, 192) 0 batch_normalization_200[0][0]
__________________________________________________________________________________________________
conv2d_201 (Conv2D) (None, 6, 6, 224) 129024 activation_200[0][0]
__________________________________________________________________________________________________
batch_normalization_201 (BatchN (None, 6, 6, 224) 672 conv2d_201[0][0]
__________________________________________________________________________________________________
activation_201 (Activation) (None, 6, 6, 224) 0 batch_normalization_201[0][0]
__________________________________________________________________________________________________
conv2d_199 (Conv2D) (None, 6, 6, 192) 399360 block8_9_ac[0][0]
__________________________________________________________________________________________________
conv2d_202 (Conv2D) (None, 6, 6, 256) 172032 activation_201[0][0]
__________________________________________________________________________________________________
batch_normalization_199 (BatchN (None, 6, 6, 192) 576 conv2d_199[0][0]
__________________________________________________________________________________________________
batch_normalization_202 (BatchN (None, 6, 6, 256) 768 conv2d_202[0][0]
__________________________________________________________________________________________________
activation_199 (Activation) (None, 6, 6, 192) 0 batch_normalization_199[0][0]
__________________________________________________________________________________________________
activation_202 (Activation) (None, 6, 6, 256) 0 batch_normalization_202[0][0]
__________________________________________________________________________________________________
block8_10_mixed (Concatenate) (None, 6, 6, 448) 0 activation_199[0][0]
activation_202[0][0]
__________________________________________________________________________________________________
block8_10_conv (Conv2D) (None, 6, 6, 2080) 933920 block8_10_mixed[0][0]
__________________________________________________________________________________________________
block8_10 (Lambda) (None, 6, 6, 2080) 0 block8_9_ac[0][0]
block8_10_conv[0][0]
__________________________________________________________________________________________________
conv_7b (Conv2D) (None, 6, 6, 1536) 3194880 block8_10[0][0]
__________________________________________________________________________________________________
conv_7b_bn (BatchNormalization) (None, 6, 6, 1536) 4608 conv_7b[0][0]
__________________________________________________________________________________________________
conv_7b_ac (Activation) (None, 6, 6, 1536) 0 conv_7b_bn[0][0]
__________________________________________________________________________________________________
flatten (Flatten) (None, 55296) 0 conv_7b_ac[0][0]
__________________________________________________________________________________________________
dense (Dense) (None, 3) 165891 flatten[0][0]
==================================================================================================
Total params: 54,502,627
Trainable params: 165,891
Non-trainable params: 54,336,736
__________________________________________________________________________________________________
None
The output of the convolutional layers of the base model will be flattened, meaning reshaping the output tensor to a 1D vector. This 1D vector will be the input to the fully connected layer to classify the images.
With the Keras "Dense" function, a fully connected prediction layer is created with 3 neurons (because we have 3 classes to predict). The flattened 1D layer is fully connected to this prediction layer.
The following image shows the structure of the classification layer and its integration to the base model:
Overfitting is a phenomenon in machine learning that occurs when a machine learning model learns the training data by hard so the model is specificaly tailored to the training dataset and cannot generalise to other, for the network unseen, datasets. With the above defined layers no overfitting occurs.
Hyper parameters like epochs and batch size are defined in the following.
Epochs is the number of loops the model is trained on the same whole training dataset.
The weights of the model will not be updated all at once when all the training data is processed, but the weights are updated many times per epoch. This is defined by the batch size.
Batch size is the number of images, the model is processing at once, calculating the gradient of the error function of all images in the batch size, then updating the weights after processing this batch, before the next batch of images will be processed.
Hyperparameters have significant impact on the results and performances of neural networks.
epochs = 100
batch_size = 40
An ImageDataGenerator generate batches of tensor image data with real-time data augmentation while training. The model will be trained on augmented data, which makes the model more robust, since the training data will be manipulated in order to be more difficult to predict. When the training process is set up on those more difficult images, it will perform better on an unmanipulated dataset.
Another profit from this method is, that you can generate more training data, when having not many images for the training process or when many images are the same because images were made with a foto-series function of a camera.
Data Augmentation produces more diverse images when the images in a batch are similar, which can be the case of images from the class "Markus", since I made many fotos in very short time with the camera's foto-series function.
# Generator for Training Dataset with Data Augmentation
gen_train = ImageDataGenerator(
rotation_range=15, # Rotate image randomly from -15° to 15°
width_shift_range=0.05, # Shift image to left or right
height_shift_range= 0.05, # Shift image in height
shear_range= 0.05, # Shear image
zoom_range=0.05, # Zoom into image in %
horizontal_flip=True, # Flip image horizontal
vertical_flip=False, # Flip image vertical (upside-down)
preprocessing_function=preprocess_input) # Preprocess input the way InceptionResNetV2 needs it, e.g. values range [-1, +1]
# Generator for Validation and Test Data (No Augmented Images)
gen = ImageDataGenerator(preprocessing_function=preprocess_input)
We need data augmentation on the training data only, because we want to generate more different data for training andt to make the network robust. Validation and Testing should be done with non-augmented data!
Create 3 seperate generators for training, validation and testing dataset:
# Generator for training data (augmented data)
train_generator = gen_train.flow_from_directory(
train_path, # Path to take images from
target_size=IMAGE_SIZE,
shuffle=True, # Shuffle the data before creating batches
batch_size=batch_size) # Specifing batch size (how many images per batch)
# Generator for validation data (non-augmented data)
valid_generator = gen.flow_from_directory(
validation_path, # Path to take images from
target_size=IMAGE_SIZE,
shuffle=True, # Shuffle the data before creating batches
batch_size=batch_size) # Specifing batch size (how many images per batch)
# Generator for test data (non-augmented data)
test_generator = gen.flow_from_directory(
test_path, # Path to take images from
target_size=IMAGE_SIZE,
shuffle=True, # Shuffle the data before creating batches
batch_size=batch_size) # Specifing batch size (how many images per batch)
Found 3129 images belonging to 3 classes. Found 615 images belonging to 3 classes. Found 349 images belonging to 3 classes.
# Show all the classes found by Keras (Code from Prof Stache "Fruit_Example.ipynb")
labels = [None] * len(train_generator.class_indices)
print(len(labels), 'Classes found!')
for k, v in train_generator.class_indices.items():
labels[v] = k
print('Found Classes: ', labels)
3 Classes found! Found Classes: ['Markus', 'Objects', 'Others']
An "Early Stopping" Callback is defined to stop training after a specified number of epochs, if no improvement in the monitored value is happening during those last epochs.
The best model weights in sense of the monitored value will be restored and chosen as the model weights of the trained network.
The value to monitor is the validation accuracy.
# Define a callback "early stopping" and restore the best weights of the model at the end of training process
early_stopping_callback = EarlyStopping(
monitor='val_accuracy', # Validation accuracy is the monitored value
restore_best_weights=True, # Restore the beste weights of training after stopping
mode='auto', # Improvement in accuracy are higher values
patience = 20, # Number of epochs to stop training when no improvement occurs
verbose=1) # Write status
callbacks_list = [early_stopping_callback] # List of callbacks used
# Fit the model to the training data using a generator for data augmentation
r = model.fit_generator(
# Specify ImageGenerator of Training and validation Dataset
train_generator,
validation_data=valid_generator,
# Specify number of epochs to run
epochs=epochs,
# Integer of total number of steps (batches of samples) to yield from Training DataGenerator
steps_per_epoch=len(image_files) // batch_size,
# Integer of total number of steps (batches of samples) to yield from Validation DataGenerator
validation_steps=len(validation_image_files) // batch_size,
# Write status
verbose=1,
# Specify callbacks
callbacks=callbacks_list)
print('Training done!')
Epoch 1/100 78/78 [==============================] - 73s 937ms/step - loss: 5.4090 - accuracy: 0.6397 - val_loss: 4.4545 - val_accuracy: 0.7100 Epoch 2/100 78/78 [==============================] - 71s 906ms/step - loss: 0.6867 - accuracy: 0.9421 - val_loss: 1.5880 - val_accuracy: 0.7883 Epoch 3/100 78/78 [==============================] - 71s 905ms/step - loss: 0.1831 - accuracy: 0.9764 - val_loss: 0.6309 - val_accuracy: 0.9017 Epoch 4/100 78/78 [==============================] - 71s 905ms/step - loss: 0.0142 - accuracy: 0.9974 - val_loss: 0.4469 - val_accuracy: 0.9100 Epoch 5/100 78/78 [==============================] - 70s 894ms/step - loss: 0.0739 - accuracy: 0.9877 - val_loss: 1.0552 - val_accuracy: 0.8800 Epoch 6/100 78/78 [==============================] - 70s 903ms/step - loss: 0.0455 - accuracy: 0.9958 - val_loss: 0.4549 - val_accuracy: 0.9450 Epoch 7/100 78/78 [==============================] - 70s 891ms/step - loss: 0.0543 - accuracy: 0.9929 - val_loss: 0.7725 - val_accuracy: 0.9017 Epoch 8/100 78/78 [==============================] - 70s 902ms/step - loss: 0.0067 - accuracy: 0.9987 - val_loss: 0.3178 - val_accuracy: 0.9550 Epoch 9/100 78/78 [==============================] - 70s 902ms/step - loss: 0.0168 - accuracy: 0.9968 - val_loss: 1.0411 - val_accuracy: 0.8883 Epoch 10/100 78/78 [==============================] - 71s 909ms/step - loss: 0.0356 - accuracy: 0.9961 - val_loss: 0.5848 - val_accuracy: 0.9300 Epoch 11/100 78/78 [==============================] - 70s 899ms/step - loss: 0.0062 - accuracy: 0.9981 - val_loss: 0.4252 - val_accuracy: 0.9483 Epoch 12/100 78/78 [==============================] - 70s 897ms/step - loss: 0.0199 - accuracy: 0.9964 - val_loss: 0.3767 - val_accuracy: 0.9533 Epoch 13/100 78/78 [==============================] - 70s 902ms/step - loss: 0.0125 - accuracy: 0.9984 - val_loss: 0.2988 - val_accuracy: 0.9600 Epoch 14/100 78/78 [==============================] - 70s 901ms/step - loss: 0.0373 - accuracy: 0.9968 - val_loss: 1.6591 - val_accuracy: 0.8300 Epoch 15/100 78/78 [==============================] - 70s 899ms/step - loss: 0.0050 - accuracy: 0.9990 - val_loss: 0.2936 - val_accuracy: 0.9600 Epoch 16/100 78/78 [==============================] - 70s 892ms/step - loss: 3.0010e-07 - accuracy: 1.0000 - val_loss: 1.1481 - val_accuracy: 0.8817 Epoch 17/100 78/78 [==============================] - 71s 911ms/step - loss: 0.0179 - accuracy: 0.9968 - val_loss: 0.7396 - val_accuracy: 0.9183 Epoch 18/100 78/78 [==============================] - 71s 913ms/step - loss: 0.0039 - accuracy: 0.9994 - val_loss: 0.5642 - val_accuracy: 0.9300 Epoch 19/100 78/78 [==============================] - 70s 894ms/step - loss: 0.0053 - accuracy: 0.9997 - val_loss: 0.2950 - val_accuracy: 0.9667 Epoch 20/100 78/78 [==============================] - 70s 894ms/step - loss: 0.0075 - accuracy: 0.9994 - val_loss: 2.0655 - val_accuracy: 0.8133 Epoch 21/100 78/78 [==============================] - 70s 903ms/step - loss: 0.0076 - accuracy: 0.9993 - val_loss: 0.2857 - val_accuracy: 0.9683 Epoch 22/100 78/78 [==============================] - 70s 902ms/step - loss: 0.0064 - accuracy: 0.9990 - val_loss: 5.1013 - val_accuracy: 0.6283 Epoch 23/100 78/78 [==============================] - 70s 900ms/step - loss: 0.0193 - accuracy: 0.9984 - val_loss: 3.4925 - val_accuracy: 0.7200 Epoch 24/100 78/78 [==============================] - 70s 896ms/step - loss: 0.0113 - accuracy: 0.9987 - val_loss: 0.6403 - val_accuracy: 0.9267 Epoch 25/100 78/78 [==============================] - 70s 903ms/step - loss: 0.0107 - accuracy: 0.9984 - val_loss: 0.9551 - val_accuracy: 0.9117 Epoch 26/100 78/78 [==============================] - 70s 900ms/step - loss: 0.0073 - accuracy: 0.9990 - val_loss: 2.0207 - val_accuracy: 0.8300 Epoch 27/100 78/78 [==============================] - 70s 894ms/step - loss: 0.0074 - accuracy: 0.9994 - val_loss: 0.4329 - val_accuracy: 0.9583 Epoch 28/100 78/78 [==============================] - 70s 896ms/step - loss: 0.0248 - accuracy: 0.9971 - val_loss: 2.0722 - val_accuracy: 0.8283 Epoch 29/100 78/78 [==============================] - 70s 899ms/step - loss: 5.3667e-07 - accuracy: 1.0000 - val_loss: 1.7921 - val_accuracy: 0.8433 Epoch 30/100 78/78 [==============================] - 70s 903ms/step - loss: 0.0104 - accuracy: 0.9994 - val_loss: 0.3587 - val_accuracy: 0.9617 Epoch 31/100 78/78 [==============================] - 70s 902ms/step - loss: 0.0101 - accuracy: 0.9981 - val_loss: 0.7558 - val_accuracy: 0.9333 Epoch 32/100 78/78 [==============================] - 70s 894ms/step - loss: 0.0050 - accuracy: 0.9987 - val_loss: 2.9752 - val_accuracy: 0.7483 Epoch 33/100 78/78 [==============================] - 70s 900ms/step - loss: 0.0010 - accuracy: 0.9994 - val_loss: 1.1090 - val_accuracy: 0.8867 Epoch 34/100 78/78 [==============================] - 70s 892ms/step - loss: 0.0034 - accuracy: 0.9994 - val_loss: 0.3887 - val_accuracy: 0.9467 Epoch 35/100 78/78 [==============================] - 71s 910ms/step - loss: 0.0031 - accuracy: 0.9997 - val_loss: 0.1617 - val_accuracy: 0.9817 Epoch 36/100 78/78 [==============================] - 70s 901ms/step - loss: 0.0051 - accuracy: 0.9994 - val_loss: 0.2383 - val_accuracy: 0.9717 Epoch 37/100 78/78 [==============================] - 70s 896ms/step - loss: 2.5938e-04 - accuracy: 0.9997 - val_loss: 0.5404 - val_accuracy: 0.9400 Epoch 38/100 78/78 [==============================] - 70s 901ms/step - loss: 0.0163 - accuracy: 0.9980 - val_loss: 0.1581 - val_accuracy: 0.9850 Epoch 39/100 78/78 [==============================] - 70s 901ms/step - loss: 0.0097 - accuracy: 0.9981 - val_loss: 2.1342 - val_accuracy: 0.8150 Epoch 40/100 78/78 [==============================] - 70s 892ms/step - loss: 3.2453e-05 - accuracy: 1.0000 - val_loss: 0.2969 - val_accuracy: 0.9567 Epoch 41/100 78/78 [==============================] - 70s 896ms/step - loss: 1.2397e-07 - accuracy: 1.0000 - val_loss: 0.3075 - val_accuracy: 0.9617 Epoch 42/100 78/78 [==============================] - 70s 894ms/step - loss: 3.6205e-04 - accuracy: 0.9997 - val_loss: 0.1859 - val_accuracy: 0.9750 Epoch 43/100 78/78 [==============================] - 70s 896ms/step - loss: 0.0052 - accuracy: 0.9997 - val_loss: 0.6116 - val_accuracy: 0.9400 Epoch 44/100 78/78 [==============================] - 70s 898ms/step - loss: 0.0052 - accuracy: 0.9994 - val_loss: 1.2440 - val_accuracy: 0.8800 Epoch 45/100 78/78 [==============================] - 69s 891ms/step - loss: 0.0130 - accuracy: 0.9987 - val_loss: 0.1986 - val_accuracy: 0.9733 Epoch 46/100 78/78 [==============================] - 70s 900ms/step - loss: 6.6156e-04 - accuracy: 0.9997 - val_loss: 0.3788 - val_accuracy: 0.9550 Epoch 47/100 78/78 [==============================] - 70s 896ms/step - loss: 4.6476e-06 - accuracy: 1.0000 - val_loss: 0.3822 - val_accuracy: 0.9633 Epoch 48/100 78/78 [==============================] - 69s 891ms/step - loss: 0.0103 - accuracy: 0.9993 - val_loss: 0.1572 - val_accuracy: 0.9833 Epoch 49/100 78/78 [==============================] - 70s 896ms/step - loss: 4.7781e-04 - accuracy: 0.9997 - val_loss: 0.1934 - val_accuracy: 0.9783 Epoch 50/100 78/78 [==============================] - 70s 901ms/step - loss: 0.0071 - accuracy: 0.9994 - val_loss: 0.4034 - val_accuracy: 0.9517 Epoch 51/100 78/78 [==============================] - 70s 896ms/step - loss: 5.4262e-05 - accuracy: 1.0000 - val_loss: 0.5567 - val_accuracy: 0.9400 Epoch 52/100 78/78 [==============================] - 70s 899ms/step - loss: 0.0082 - accuracy: 0.9987 - val_loss: 0.5133 - val_accuracy: 0.9400 Epoch 53/100 78/78 [==============================] - 70s 892ms/step - loss: 0.0026 - accuracy: 0.9993 - val_loss: 0.6449 - val_accuracy: 0.9383 Epoch 54/100 78/78 [==============================] - 71s 905ms/step - loss: 1.1987e-06 - accuracy: 1.0000 - val_loss: 2.2823 - val_accuracy: 0.8117 Epoch 55/100 78/78 [==============================] - 73s 930ms/step - loss: 3.0811e-04 - accuracy: 0.9997 - val_loss: 2.2597 - val_accuracy: 0.8167 Epoch 56/100 78/78 [==============================] - 70s 900ms/step - loss: 0.0024 - accuracy: 0.9997 - val_loss: 0.7036 - val_accuracy: 0.9367 Epoch 57/100 78/78 [==============================] - 70s 901ms/step - loss: 4.8668e-07 - accuracy: 1.0000 - val_loss: 0.9196 - val_accuracy: 0.9083 Epoch 58/100 77/78 [============================>.] - ETA: 0s - loss: 7.1818e-05 - accuracy: 1.0000Restoring model weights from the end of the best epoch. 78/78 [==============================] - 70s 903ms/step - loss: 7.0908e-05 - accuracy: 1.0000 - val_loss: 1.2565 - val_accuracy: 0.9050 Epoch 00058: early stopping Training done!
The best performing model during training is used to evaluate the dataset.
Evaluate and print the losses and accuracies of the three datasets:
train_loss, train_acc = model.evaluate_generator(train_generator)
val_loss, val_acc = model.evaluate_generator(valid_generator)
test_loss, test_acc = model.evaluate_generator(test_generator)
print('Train Accuracy: ', train_acc, '\nTrain Loss: ', train_loss, '\n' + 45*'_')
print('Validation Accuracy: ', val_acc, '\nValidation Loss: ', val_loss, '\n' + 45*'_')
print('Test Accuracy: ', test_acc, '\nTest Loss: ', test_loss)
Train Accuracy: 0.985938 Train Loss: 0.13208026663322647 _____________________________________________ Validation Accuracy: 0.98536587 Validation Loss: 0.14818506717757796 _____________________________________________ Test Accuracy: 0.98567337 Test Loss: 0.17266843203684978
The accuracy values of the unseen data of validation and test dataset are at 98,5% and 98,6% which is a very good result since most images are predicted correctly!
# Plot the training & validation losses during training versus the epochs
plt.plot(r.history['loss'], label='train loss')
plt.plot(r.history['val_loss'], label='val loss')
plt.legend()
plt.ylabel('Loss')
plt.xlabel('Epochs')
plt.show()
# Plot the training & validation accuracies during training versus the epochs
plt.plot(r.history['accuracy'], label='train acc')
plt.plot(r.history['val_accuracy'], label='val acc')
plt.legend()
plt.ylabel('Accuracy')
plt.xlabel('Epochs')
plt.show()
In order to find out which classes interfere with each other, a confusion matrix will be created.
Other metrics than accuracy will be calculated with the sklearn.metrics package like Precision and Recall. Based on a 2 class confusion matrix (image below), the True positives, true negatives, false positives and false negatives can be calculated and different metrics can be evaluated based on that. There are many more metrics to evaluate a model, as you can see in the following image:
Source of Image: https://en.wikipedia.org/wiki/Precision_and_recall
We will focus on accuracy, precision and recall.
The accuracy (ACC) is defined as the sum of all true positives plus the sum of all true negatives divided by the sum of the total population (total samples of images):
$\text{Accuracy} = \frac{TP + TN}{TP + TN + FP + FN}.$
It answers the question: "What proportion of all predictions on the images were actually predicted correct?"
But sometimes, especially on imbalanced datasets, the evaluation of only accuracy as metric can be misleading and dangerous because accuracy alone doesn't give a good impression of the performance of the model.
Because of this fact, we need to evaluate other metrics like precision and recall to be sure to have a good model.
The Recall (also known as Sensitivity or true positive rate (TPR)) is defined as:
$\text{Recall} = \frac{TP}{TP + FN}$
Recall answers the question "What proportion of actually positive conditions was identified correctly?"
Or in terms of facial recognition: what proportion of actually "Markus" images was identified correctly as "Markus"?
The precision (also known as positive predictive value (PPV)) is defined as:
$\text{Precision} = \frac{TP}{TP + FP}$
Precision is answering the question "What proportion of positive identifications was actually correct?"
Or: What proportion of all identifications as "Markus" was actually an image of "Markus"?
(Definition of recall and precision source: https://developers.google.com/machine-learning/crash-course/classification/precision-and-recall)
Every class has their own value of precision and recall. For example there is the positive condition "Markus" which includes all samples of the class "Markus" and there is the negative condition "not Markus", which includes the remaining classes "Objects" and "Others". The same for the other two classes "Others" and "Objects". Based on that, three 2x2 confusion matrices can be calculated and a precision and recall value for each class can be calculated.
# Import the functionality to calculate the metrics from sklearn.metrics
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import accuracy_score
# Basic code is from Fruit Example Jupyter Notebook from Prof. Dr.-Ing. Stache
def get_metrics(data_path, N, name):
"""Get accuracy, precision and recall and confusion matrix of a dataset evaluated by the neural network.
Keyword arguments:
data_path -- string of the path of the evaluated dataset (train, validation or test dataset)
N -- number of total image files in the dataset
name -- information of used dataset (train, validation or test)
"""
print("\nGenerating confusion matrix", N)
predictions = [] # Empty list of predictions
targets = [] # Empty list of Ground Truth of predictions
i = 0
for x, y in gen.flow_from_directory(data_path, target_size=IMAGE_SIZE, shuffle=False, batch_size=batch_size):
i += 1
if i % 50 == 0:
print(i)
p = model.predict(x) # Predict class on image x
p = np.argmax(p, axis=1) # Number of class of the prediction
y = np.argmax(y, axis=1) # Number of class that is ground truth of x
predictions = np.concatenate((predictions, p)) # Include new prediction to list
targets = np.concatenate((targets, y)) # Include new ground truth to list
if len(targets) >= N:
break
# Calculate confusion matrix based on list of predictions and ground truths
cm = confusion_matrix(targets, predictions)
# Calculate accuracy
print('\n\n ##' + name + ' SET##' + '\nMetrics Information on Labels: ', labels)
acc = accuracy_score(targets, predictions)
print('ACCURACY: ', acc)
# Calculate precision
precision = precision_score(targets, predictions, average=None)
print('PRECISION: ', precision)
# Calculate recall
recall = recall_score(targets, predictions, average=None)
print('RECALL: ', recall)
print(60*'_')
return cm # Return confusion matrix array to plot them later
# Calculate metrics for training, validation and test dataset
train_cm = get_metrics(train_path, len(image_files), 'TRAINING')
valid_cm = get_metrics(validation_path, len(validation_image_files), 'VALIDATION')
test_cm = get_metrics(test_path, len(test_image_files), 'TEST')
Generating confusion matrix 3129 Found 3129 images belonging to 3 classes. 50 ##TRAINING SET## Metrics Information on Labels: ['Markus', 'Objects', 'Others'] ACCURACY: 0.9881751358261426 PRECISION: [0.97291022 1. 0.9979716 ] RECALL: [0.99841144 0.99415888 0.9704142 ] ____________________________________________________________ Generating confusion matrix 615 Found 615 images belonging to 3 classes. ##VALIDATION SET## Metrics Information on Labels: ['Markus', 'Objects', 'Others'] ACCURACY: 0.9853658536585366 PRECISION: [0.96850394 1. 0.99484536] RECALL: [0.99595142 0.99404762 0.965 ] ____________________________________________________________ Generating confusion matrix 349 Found 349 images belonging to 3 classes. ##TEST SET## Metrics Information on Labels: ['Markus', 'Objects', 'Others'] ACCURACY: 0.9856733524355301 PRECISION: [0.96551724 1. 1. ] RECALL: [1. 0.98958333 0.96460177] ____________________________________________________________
The accuracy of the model on unseen data (validation and test data) is greater than 98,5 % in both the validation and test dataset which is a very good result.
In the validation dataset the class "Markus" have the lowest precision with 96,9% and the class "Objects" have the highest with 100%.
In the test dataset the class "Markus" have the lowest precision with 96,6% and the class "Objects" and "Others" have the highest with 100%.
In the validation dataset the class "Others" have the lowest recall with 96,5% and the class "Markus" have the highest with 99.6%.
In the test dataset the class "Others" have the lowest recall with 96,5% and the class "Markus" has the highest with 100%.
The confusion matrix is plotted with the code from the Fruit Examples notebook of Prof. Dr-Ing. Stache.
def plot_confusion_matrix(cm, name):
"""Plot the confusion matrix.
Keyword Arguments:
cm -- 3x3 array confusion matrix based on all 3 classes
name -- information of used dataset (train, validation or test)
"""
plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues)
plt.title(name + ' confusion matrix')
plt.colorbar()
tick_marks = np.arange(len(labels))
plt.xticks(tick_marks, labels, rotation=45)
plt.yticks(tick_marks, labels)
fmt = 'd'
thresh = cm.max() / 2.
for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):
plt.text(j, i, format(cm[i, j], fmt),
horizontalalignment="center",
color="white" if cm[i, j] > thresh else "black")
plt.tight_layout()
plt.ylabel('True label')
plt.xlabel('Predicted label')
plt.show()
plot_confusion_matrix(train_cm, 'TRAIN')
In the training dataset the network predicted 30 Images of "Others" falsely as "Markus", 5 images of "Objects" falsely as "Markus" and 2 images of "Markus" falsely as "Others". All of the other 3092 training images were correctly classified.
plot_confusion_matrix(valid_cm, 'VALIDATION')
In the validation dataset the network predicted 7 Images of "Others" falsely as "Markus", 1 image of "Objects" falsely as "Markus" and 1 image of "Markus" falsely as "Others". All of the other 606 validation images were correctly classified.
plot_confusion_matrix(test_cm, 'TEST')
In the test dataset the network predicted 4 Images of "Others" falsely as "Markus", 1 image of "Objects" falsely as "Markus". All of the other 344 test images were correctly classified.
Since the deep learning network "InceptionResNetV2" has a memory size of 215 MB and a depth of 572, it is not very efficient for the use on mobile devices in real time apps or on embedded systems when computational power is limited.
Because of that, researchers from Google released a neural network architecture, the "MobileNetV2", that is optimized for the use on mobile devices and embedded vision applications. It has a memory size of only 14 MB and a depth of layers of 88.
This network has high accuracy results on image classification tasks while keeping the parameters and mathematical operations as low as possible, so that it can work fast and efficient on mobile devices.
Neural networks need to work efficient these days because new mobile applications entering the market allows users to interact with the real world in realtime. The MobileNetV2 network is an improved version of the MobileNetV1 in terms like:
In the following code sections, a neural network is trained with transfer learning based on the MobileNetV2 from Google. The pipeline of the training is the same as training the InceptionResNetV2 in all the above code cells in this notebook. Data Augmentation is used in the training dataset, too. The Keras ImageData generators have to be created again, because we need to pass the preprocess_input function of the MobileNetV2 to meet the preprocessing needs of the new network.
The MobileNetV2 is loaded without top layers and with all weights of the basemodel freezed. The output of the basemodel of MobileNetV2 is then flattened and then connected to a fully connected Dense layer with 200 Neuron units and a relu activation function. This layer is then connected to another Dense layer with 3 neurons with a softmax activation function (prediction layer). The top layer structure is shown in the following image:
The training will be stopped with an Early-Stopping callback after 20 epochs of no improvement in validation accuracy. Because of the similarity of the training process from the first deep learning model, the code below for the MobileNetV2 is compressed in few code cells.
tf.keras.backend.clear_session() # Clear tf session
from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2 # Import MobileNetV2 model
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input # Import preprocess specifications for MobileNetV2
# Generator for Training Dataset with Data Augmentation
gen_train = ImageDataGenerator(
rotation_range=15, # Rotate image randomly from -15° to 15°
width_shift_range=0.05, # Shift image to left or right
height_shift_range= 0.05, # Shift image in height
shear_range= 0.05, # Shear image
zoom_range=0.05, # Zoom into image in %
horizontal_flip=True, # Flip image horizontal
vertical_flip=False, # Flip image vertical (upside-down)
preprocessing_function=preprocess_input) # Preprocess input the way InceptionResNetV2 needs it, e.g. values range [-1, +1]
# Generator for Validation and Test Data (No Augmented Images)
gen = ImageDataGenerator(preprocessing_function=preprocess_input) # rescale=1.0/255
# Generator for training data (augmented data)
train_generator = gen_train.flow_from_directory(
train_path, # Path to take images from
target_size=IMAGE_SIZE,
shuffle=True, # Shuffle the data before creating batches
batch_size=batch_size) # Specifing batch size (how many images per batch)
# Generator for validation data (non-augmented data)
valid_generator = gen.flow_from_directory(
validation_path, # Path to take images from
target_size=IMAGE_SIZE,
shuffle=True, # Shuffle the data before creating batches
batch_size=batch_size) # Specifing batch size (how many images per batch)
# Generator for test data (non-augmented data)
test_generator = gen.flow_from_directory(
test_path, # Path to take images from
target_size=IMAGE_SIZE,
shuffle=True, # Shuffle the data before creating batches
batch_size=batch_size) # Specifing batch size (how many images per batch)
Found 3129 images belonging to 3 classes. Found 615 images belonging to 3 classes. Found 349 images belonging to 3 classes.
# Define base_model as MobileNetV2 model without top layers and load imagenet weights
base_model = MobileNetV2(input_shape=IMAGE_SIZE + [3], weights='imagenet', include_top=False)
def create_model_mobileNetV2():
"""Set up the deep neural network based on MobileNetV2 model and return the created model"""
# Do not train pretrained base_model weights/ freeze them
for layer in base_model.layers:
layer.trainable = False
# Flatten the output of the base model
x = Flatten()(base_model.output)
# Dense layer with 200 neurons which is fully connected to the flattened output
x = Dense(200,
activation='relu')(x) # Fully connected layer with 200 neurons
# Dense layer as prediction layer with 3 neurons
prediction = Dense(len(folders),
activation='softmax')(x)
# Create a model object from inputs and outputs of the whole pipeline
model = Model(inputs=base_model.input, outputs=prediction)
# Print the structure of the resulting deep learning model
print(model.summary())
# Define the cost and optimization method of the model to use in the training process
model.compile(
loss='categorical_crossentropy', # loss for categorical data
optimizer='rmsprop', #adam, nadam rmsprop
metrics=['accuracy'])
return model
# Instantiate our model2 object for the training, validation and testing process
model2 = create_model_mobileNetV2()
D:\PROGRAMME\Anaconda\envs\dl\lib\site-packages\keras_applications\mobilenet_v2.py:294: UserWarning: `input_shape` is undefined or non-square, or `rows` is not in [96, 128, 160, 192, 224]. Weights for input shape (224, 224) will be loaded as the default.
warnings.warn('`input_shape` is undefined or non-square, '
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 240, 240, 3) 0
__________________________________________________________________________________________________
Conv1_pad (ZeroPadding2D) (None, 241, 241, 3) 0 input_1[0][0]
__________________________________________________________________________________________________
Conv1 (Conv2D) (None, 120, 120, 32) 864 Conv1_pad[0][0]
__________________________________________________________________________________________________
bn_Conv1 (BatchNormalization) (None, 120, 120, 32) 128 Conv1[0][0]
__________________________________________________________________________________________________
Conv1_relu (ReLU) (None, 120, 120, 32) 0 bn_Conv1[0][0]
__________________________________________________________________________________________________
expanded_conv_depthwise (Depthw (None, 120, 120, 32) 288 Conv1_relu[0][0]
__________________________________________________________________________________________________
expanded_conv_depthwise_BN (Bat (None, 120, 120, 32) 128 expanded_conv_depthwise[0][0]
__________________________________________________________________________________________________
expanded_conv_depthwise_relu (R (None, 120, 120, 32) 0 expanded_conv_depthwise_BN[0][0]
__________________________________________________________________________________________________
expanded_conv_project (Conv2D) (None, 120, 120, 16) 512 expanded_conv_depthwise_relu[0][0
__________________________________________________________________________________________________
expanded_conv_project_BN (Batch (None, 120, 120, 16) 64 expanded_conv_project[0][0]
__________________________________________________________________________________________________
block_1_expand (Conv2D) (None, 120, 120, 96) 1536 expanded_conv_project_BN[0][0]
__________________________________________________________________________________________________
block_1_expand_BN (BatchNormali (None, 120, 120, 96) 384 block_1_expand[0][0]
__________________________________________________________________________________________________
block_1_expand_relu (ReLU) (None, 120, 120, 96) 0 block_1_expand_BN[0][0]
__________________________________________________________________________________________________
block_1_pad (ZeroPadding2D) (None, 121, 121, 96) 0 block_1_expand_relu[0][0]
__________________________________________________________________________________________________
block_1_depthwise (DepthwiseCon (None, 60, 60, 96) 864 block_1_pad[0][0]
__________________________________________________________________________________________________
block_1_depthwise_BN (BatchNorm (None, 60, 60, 96) 384 block_1_depthwise[0][0]
__________________________________________________________________________________________________
block_1_depthwise_relu (ReLU) (None, 60, 60, 96) 0 block_1_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_1_project (Conv2D) (None, 60, 60, 24) 2304 block_1_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_1_project_BN (BatchNormal (None, 60, 60, 24) 96 block_1_project[0][0]
__________________________________________________________________________________________________
block_2_expand (Conv2D) (None, 60, 60, 144) 3456 block_1_project_BN[0][0]
__________________________________________________________________________________________________
block_2_expand_BN (BatchNormali (None, 60, 60, 144) 576 block_2_expand[0][0]
__________________________________________________________________________________________________
block_2_expand_relu (ReLU) (None, 60, 60, 144) 0 block_2_expand_BN[0][0]
__________________________________________________________________________________________________
block_2_depthwise (DepthwiseCon (None, 60, 60, 144) 1296 block_2_expand_relu[0][0]
__________________________________________________________________________________________________
block_2_depthwise_BN (BatchNorm (None, 60, 60, 144) 576 block_2_depthwise[0][0]
__________________________________________________________________________________________________
block_2_depthwise_relu (ReLU) (None, 60, 60, 144) 0 block_2_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_2_project (Conv2D) (None, 60, 60, 24) 3456 block_2_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_2_project_BN (BatchNormal (None, 60, 60, 24) 96 block_2_project[0][0]
__________________________________________________________________________________________________
block_2_add (Add) (None, 60, 60, 24) 0 block_1_project_BN[0][0]
block_2_project_BN[0][0]
__________________________________________________________________________________________________
block_3_expand (Conv2D) (None, 60, 60, 144) 3456 block_2_add[0][0]
__________________________________________________________________________________________________
block_3_expand_BN (BatchNormali (None, 60, 60, 144) 576 block_3_expand[0][0]
__________________________________________________________________________________________________
block_3_expand_relu (ReLU) (None, 60, 60, 144) 0 block_3_expand_BN[0][0]
__________________________________________________________________________________________________
block_3_pad (ZeroPadding2D) (None, 61, 61, 144) 0 block_3_expand_relu[0][0]
__________________________________________________________________________________________________
block_3_depthwise (DepthwiseCon (None, 30, 30, 144) 1296 block_3_pad[0][0]
__________________________________________________________________________________________________
block_3_depthwise_BN (BatchNorm (None, 30, 30, 144) 576 block_3_depthwise[0][0]
__________________________________________________________________________________________________
block_3_depthwise_relu (ReLU) (None, 30, 30, 144) 0 block_3_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_3_project (Conv2D) (None, 30, 30, 32) 4608 block_3_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_3_project_BN (BatchNormal (None, 30, 30, 32) 128 block_3_project[0][0]
__________________________________________________________________________________________________
block_4_expand (Conv2D) (None, 30, 30, 192) 6144 block_3_project_BN[0][0]
__________________________________________________________________________________________________
block_4_expand_BN (BatchNormali (None, 30, 30, 192) 768 block_4_expand[0][0]
__________________________________________________________________________________________________
block_4_expand_relu (ReLU) (None, 30, 30, 192) 0 block_4_expand_BN[0][0]
__________________________________________________________________________________________________
block_4_depthwise (DepthwiseCon (None, 30, 30, 192) 1728 block_4_expand_relu[0][0]
__________________________________________________________________________________________________
block_4_depthwise_BN (BatchNorm (None, 30, 30, 192) 768 block_4_depthwise[0][0]
__________________________________________________________________________________________________
block_4_depthwise_relu (ReLU) (None, 30, 30, 192) 0 block_4_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_4_project (Conv2D) (None, 30, 30, 32) 6144 block_4_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_4_project_BN (BatchNormal (None, 30, 30, 32) 128 block_4_project[0][0]
__________________________________________________________________________________________________
block_4_add (Add) (None, 30, 30, 32) 0 block_3_project_BN[0][0]
block_4_project_BN[0][0]
__________________________________________________________________________________________________
block_5_expand (Conv2D) (None, 30, 30, 192) 6144 block_4_add[0][0]
__________________________________________________________________________________________________
block_5_expand_BN (BatchNormali (None, 30, 30, 192) 768 block_5_expand[0][0]
__________________________________________________________________________________________________
block_5_expand_relu (ReLU) (None, 30, 30, 192) 0 block_5_expand_BN[0][0]
__________________________________________________________________________________________________
block_5_depthwise (DepthwiseCon (None, 30, 30, 192) 1728 block_5_expand_relu[0][0]
__________________________________________________________________________________________________
block_5_depthwise_BN (BatchNorm (None, 30, 30, 192) 768 block_5_depthwise[0][0]
__________________________________________________________________________________________________
block_5_depthwise_relu (ReLU) (None, 30, 30, 192) 0 block_5_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_5_project (Conv2D) (None, 30, 30, 32) 6144 block_5_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_5_project_BN (BatchNormal (None, 30, 30, 32) 128 block_5_project[0][0]
__________________________________________________________________________________________________
block_5_add (Add) (None, 30, 30, 32) 0 block_4_add[0][0]
block_5_project_BN[0][0]
__________________________________________________________________________________________________
block_6_expand (Conv2D) (None, 30, 30, 192) 6144 block_5_add[0][0]
__________________________________________________________________________________________________
block_6_expand_BN (BatchNormali (None, 30, 30, 192) 768 block_6_expand[0][0]
__________________________________________________________________________________________________
block_6_expand_relu (ReLU) (None, 30, 30, 192) 0 block_6_expand_BN[0][0]
__________________________________________________________________________________________________
block_6_pad (ZeroPadding2D) (None, 31, 31, 192) 0 block_6_expand_relu[0][0]
__________________________________________________________________________________________________
block_6_depthwise (DepthwiseCon (None, 15, 15, 192) 1728 block_6_pad[0][0]
__________________________________________________________________________________________________
block_6_depthwise_BN (BatchNorm (None, 15, 15, 192) 768 block_6_depthwise[0][0]
__________________________________________________________________________________________________
block_6_depthwise_relu (ReLU) (None, 15, 15, 192) 0 block_6_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_6_project (Conv2D) (None, 15, 15, 64) 12288 block_6_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_6_project_BN (BatchNormal (None, 15, 15, 64) 256 block_6_project[0][0]
__________________________________________________________________________________________________
block_7_expand (Conv2D) (None, 15, 15, 384) 24576 block_6_project_BN[0][0]
__________________________________________________________________________________________________
block_7_expand_BN (BatchNormali (None, 15, 15, 384) 1536 block_7_expand[0][0]
__________________________________________________________________________________________________
block_7_expand_relu (ReLU) (None, 15, 15, 384) 0 block_7_expand_BN[0][0]
__________________________________________________________________________________________________
block_7_depthwise (DepthwiseCon (None, 15, 15, 384) 3456 block_7_expand_relu[0][0]
__________________________________________________________________________________________________
block_7_depthwise_BN (BatchNorm (None, 15, 15, 384) 1536 block_7_depthwise[0][0]
__________________________________________________________________________________________________
block_7_depthwise_relu (ReLU) (None, 15, 15, 384) 0 block_7_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_7_project (Conv2D) (None, 15, 15, 64) 24576 block_7_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_7_project_BN (BatchNormal (None, 15, 15, 64) 256 block_7_project[0][0]
__________________________________________________________________________________________________
block_7_add (Add) (None, 15, 15, 64) 0 block_6_project_BN[0][0]
block_7_project_BN[0][0]
__________________________________________________________________________________________________
block_8_expand (Conv2D) (None, 15, 15, 384) 24576 block_7_add[0][0]
__________________________________________________________________________________________________
block_8_expand_BN (BatchNormali (None, 15, 15, 384) 1536 block_8_expand[0][0]
__________________________________________________________________________________________________
block_8_expand_relu (ReLU) (None, 15, 15, 384) 0 block_8_expand_BN[0][0]
__________________________________________________________________________________________________
block_8_depthwise (DepthwiseCon (None, 15, 15, 384) 3456 block_8_expand_relu[0][0]
__________________________________________________________________________________________________
block_8_depthwise_BN (BatchNorm (None, 15, 15, 384) 1536 block_8_depthwise[0][0]
__________________________________________________________________________________________________
block_8_depthwise_relu (ReLU) (None, 15, 15, 384) 0 block_8_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_8_project (Conv2D) (None, 15, 15, 64) 24576 block_8_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_8_project_BN (BatchNormal (None, 15, 15, 64) 256 block_8_project[0][0]
__________________________________________________________________________________________________
block_8_add (Add) (None, 15, 15, 64) 0 block_7_add[0][0]
block_8_project_BN[0][0]
__________________________________________________________________________________________________
block_9_expand (Conv2D) (None, 15, 15, 384) 24576 block_8_add[0][0]
__________________________________________________________________________________________________
block_9_expand_BN (BatchNormali (None, 15, 15, 384) 1536 block_9_expand[0][0]
__________________________________________________________________________________________________
block_9_expand_relu (ReLU) (None, 15, 15, 384) 0 block_9_expand_BN[0][0]
__________________________________________________________________________________________________
block_9_depthwise (DepthwiseCon (None, 15, 15, 384) 3456 block_9_expand_relu[0][0]
__________________________________________________________________________________________________
block_9_depthwise_BN (BatchNorm (None, 15, 15, 384) 1536 block_9_depthwise[0][0]
__________________________________________________________________________________________________
block_9_depthwise_relu (ReLU) (None, 15, 15, 384) 0 block_9_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_9_project (Conv2D) (None, 15, 15, 64) 24576 block_9_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_9_project_BN (BatchNormal (None, 15, 15, 64) 256 block_9_project[0][0]
__________________________________________________________________________________________________
block_9_add (Add) (None, 15, 15, 64) 0 block_8_add[0][0]
block_9_project_BN[0][0]
__________________________________________________________________________________________________
block_10_expand (Conv2D) (None, 15, 15, 384) 24576 block_9_add[0][0]
__________________________________________________________________________________________________
block_10_expand_BN (BatchNormal (None, 15, 15, 384) 1536 block_10_expand[0][0]
__________________________________________________________________________________________________
block_10_expand_relu (ReLU) (None, 15, 15, 384) 0 block_10_expand_BN[0][0]
__________________________________________________________________________________________________
block_10_depthwise (DepthwiseCo (None, 15, 15, 384) 3456 block_10_expand_relu[0][0]
__________________________________________________________________________________________________
block_10_depthwise_BN (BatchNor (None, 15, 15, 384) 1536 block_10_depthwise[0][0]
__________________________________________________________________________________________________
block_10_depthwise_relu (ReLU) (None, 15, 15, 384) 0 block_10_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_10_project (Conv2D) (None, 15, 15, 96) 36864 block_10_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_10_project_BN (BatchNorma (None, 15, 15, 96) 384 block_10_project[0][0]
__________________________________________________________________________________________________
block_11_expand (Conv2D) (None, 15, 15, 576) 55296 block_10_project_BN[0][0]
__________________________________________________________________________________________________
block_11_expand_BN (BatchNormal (None, 15, 15, 576) 2304 block_11_expand[0][0]
__________________________________________________________________________________________________
block_11_expand_relu (ReLU) (None, 15, 15, 576) 0 block_11_expand_BN[0][0]
__________________________________________________________________________________________________
block_11_depthwise (DepthwiseCo (None, 15, 15, 576) 5184 block_11_expand_relu[0][0]
__________________________________________________________________________________________________
block_11_depthwise_BN (BatchNor (None, 15, 15, 576) 2304 block_11_depthwise[0][0]
__________________________________________________________________________________________________
block_11_depthwise_relu (ReLU) (None, 15, 15, 576) 0 block_11_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_11_project (Conv2D) (None, 15, 15, 96) 55296 block_11_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_11_project_BN (BatchNorma (None, 15, 15, 96) 384 block_11_project[0][0]
__________________________________________________________________________________________________
block_11_add (Add) (None, 15, 15, 96) 0 block_10_project_BN[0][0]
block_11_project_BN[0][0]
__________________________________________________________________________________________________
block_12_expand (Conv2D) (None, 15, 15, 576) 55296 block_11_add[0][0]
__________________________________________________________________________________________________
block_12_expand_BN (BatchNormal (None, 15, 15, 576) 2304 block_12_expand[0][0]
__________________________________________________________________________________________________
block_12_expand_relu (ReLU) (None, 15, 15, 576) 0 block_12_expand_BN[0][0]
__________________________________________________________________________________________________
block_12_depthwise (DepthwiseCo (None, 15, 15, 576) 5184 block_12_expand_relu[0][0]
__________________________________________________________________________________________________
block_12_depthwise_BN (BatchNor (None, 15, 15, 576) 2304 block_12_depthwise[0][0]
__________________________________________________________________________________________________
block_12_depthwise_relu (ReLU) (None, 15, 15, 576) 0 block_12_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_12_project (Conv2D) (None, 15, 15, 96) 55296 block_12_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_12_project_BN (BatchNorma (None, 15, 15, 96) 384 block_12_project[0][0]
__________________________________________________________________________________________________
block_12_add (Add) (None, 15, 15, 96) 0 block_11_add[0][0]
block_12_project_BN[0][0]
__________________________________________________________________________________________________
block_13_expand (Conv2D) (None, 15, 15, 576) 55296 block_12_add[0][0]
__________________________________________________________________________________________________
block_13_expand_BN (BatchNormal (None, 15, 15, 576) 2304 block_13_expand[0][0]
__________________________________________________________________________________________________
block_13_expand_relu (ReLU) (None, 15, 15, 576) 0 block_13_expand_BN[0][0]
__________________________________________________________________________________________________
block_13_pad (ZeroPadding2D) (None, 17, 17, 576) 0 block_13_expand_relu[0][0]
__________________________________________________________________________________________________
block_13_depthwise (DepthwiseCo (None, 8, 8, 576) 5184 block_13_pad[0][0]
__________________________________________________________________________________________________
block_13_depthwise_BN (BatchNor (None, 8, 8, 576) 2304 block_13_depthwise[0][0]
__________________________________________________________________________________________________
block_13_depthwise_relu (ReLU) (None, 8, 8, 576) 0 block_13_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_13_project (Conv2D) (None, 8, 8, 160) 92160 block_13_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_13_project_BN (BatchNorma (None, 8, 8, 160) 640 block_13_project[0][0]
__________________________________________________________________________________________________
block_14_expand (Conv2D) (None, 8, 8, 960) 153600 block_13_project_BN[0][0]
__________________________________________________________________________________________________
block_14_expand_BN (BatchNormal (None, 8, 8, 960) 3840 block_14_expand[0][0]
__________________________________________________________________________________________________
block_14_expand_relu (ReLU) (None, 8, 8, 960) 0 block_14_expand_BN[0][0]
__________________________________________________________________________________________________
block_14_depthwise (DepthwiseCo (None, 8, 8, 960) 8640 block_14_expand_relu[0][0]
__________________________________________________________________________________________________
block_14_depthwise_BN (BatchNor (None, 8, 8, 960) 3840 block_14_depthwise[0][0]
__________________________________________________________________________________________________
block_14_depthwise_relu (ReLU) (None, 8, 8, 960) 0 block_14_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_14_project (Conv2D) (None, 8, 8, 160) 153600 block_14_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_14_project_BN (BatchNorma (None, 8, 8, 160) 640 block_14_project[0][0]
__________________________________________________________________________________________________
block_14_add (Add) (None, 8, 8, 160) 0 block_13_project_BN[0][0]
block_14_project_BN[0][0]
__________________________________________________________________________________________________
block_15_expand (Conv2D) (None, 8, 8, 960) 153600 block_14_add[0][0]
__________________________________________________________________________________________________
block_15_expand_BN (BatchNormal (None, 8, 8, 960) 3840 block_15_expand[0][0]
__________________________________________________________________________________________________
block_15_expand_relu (ReLU) (None, 8, 8, 960) 0 block_15_expand_BN[0][0]
__________________________________________________________________________________________________
block_15_depthwise (DepthwiseCo (None, 8, 8, 960) 8640 block_15_expand_relu[0][0]
__________________________________________________________________________________________________
block_15_depthwise_BN (BatchNor (None, 8, 8, 960) 3840 block_15_depthwise[0][0]
__________________________________________________________________________________________________
block_15_depthwise_relu (ReLU) (None, 8, 8, 960) 0 block_15_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_15_project (Conv2D) (None, 8, 8, 160) 153600 block_15_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_15_project_BN (BatchNorma (None, 8, 8, 160) 640 block_15_project[0][0]
__________________________________________________________________________________________________
block_15_add (Add) (None, 8, 8, 160) 0 block_14_add[0][0]
block_15_project_BN[0][0]
__________________________________________________________________________________________________
block_16_expand (Conv2D) (None, 8, 8, 960) 153600 block_15_add[0][0]
__________________________________________________________________________________________________
block_16_expand_BN (BatchNormal (None, 8, 8, 960) 3840 block_16_expand[0][0]
__________________________________________________________________________________________________
block_16_expand_relu (ReLU) (None, 8, 8, 960) 0 block_16_expand_BN[0][0]
__________________________________________________________________________________________________
block_16_depthwise (DepthwiseCo (None, 8, 8, 960) 8640 block_16_expand_relu[0][0]
__________________________________________________________________________________________________
block_16_depthwise_BN (BatchNor (None, 8, 8, 960) 3840 block_16_depthwise[0][0]
__________________________________________________________________________________________________
block_16_depthwise_relu (ReLU) (None, 8, 8, 960) 0 block_16_depthwise_BN[0][0]
__________________________________________________________________________________________________
block_16_project (Conv2D) (None, 8, 8, 320) 307200 block_16_depthwise_relu[0][0]
__________________________________________________________________________________________________
block_16_project_BN (BatchNorma (None, 8, 8, 320) 1280 block_16_project[0][0]
__________________________________________________________________________________________________
Conv_1 (Conv2D) (None, 8, 8, 1280) 409600 block_16_project_BN[0][0]
__________________________________________________________________________________________________
Conv_1_bn (BatchNormalization) (None, 8, 8, 1280) 5120 Conv_1[0][0]
__________________________________________________________________________________________________
out_relu (ReLU) (None, 8, 8, 1280) 0 Conv_1_bn[0][0]
__________________________________________________________________________________________________
flatten (Flatten) (None, 81920) 0 out_relu[0][0]
__________________________________________________________________________________________________
dense (Dense) (None, 200) 16384200 flatten[0][0]
__________________________________________________________________________________________________
dense_1 (Dense) (None, 3) 603 dense[0][0]
==================================================================================================
Total params: 18,642,787
Trainable params: 16,384,803
Non-trainable params: 2,257,984
__________________________________________________________________________________________________
None
# Fit the model to the training data using a generator for data augmentation
r2 = model2.fit_generator(
# ImageGenerator of Training and validation Dataset
train_generator,
validation_data=valid_generator,
# Specify number of epochs to run
epochs=epochs,
# Integer of total number of steps (batches of samples) to yield from Training DataGenerator
steps_per_epoch=len(image_files) // batch_size,
# Integer of total number of steps (batches of samples) to yield from Validation DataGenerator
validation_steps=len(validation_image_files) // batch_size,
# Write status
verbose=1,
# Specify callbacks
callbacks=callbacks_list)
print('Training done!')
Epoch 1/100 78/78 [==============================] - 46s 584ms/step - loss: 5.2697 - accuracy: 0.6691 - val_loss: 5.8717 - val_accuracy: 0.6267 Epoch 2/100 78/78 [==============================] - 45s 579ms/step - loss: 4.6035 - accuracy: 0.7151 - val_loss: 5.0387 - val_accuracy: 0.6833 Epoch 3/100 78/78 [==============================] - 45s 573ms/step - loss: 4.5936 - accuracy: 0.7151 - val_loss: 5.7361 - val_accuracy: 0.6350 Epoch 4/100 78/78 [==============================] - 45s 581ms/step - loss: 4.4527 - accuracy: 0.7232 - val_loss: 5.0299 - val_accuracy: 0.6850 Epoch 5/100 78/78 [==============================] - 44s 566ms/step - loss: 4.6514 - accuracy: 0.7109 - val_loss: 6.2719 - val_accuracy: 0.6033 Epoch 6/100 78/78 [==============================] - 44s 568ms/step - loss: 0.8938 - accuracy: 0.9424 - val_loss: 3.5784 - val_accuracy: 0.7667 Epoch 7/100 78/78 [==============================] - 44s 565ms/step - loss: 0.1719 - accuracy: 0.9883 - val_loss: 1.9934 - val_accuracy: 0.8667 Epoch 8/100 78/78 [==============================] - 44s 563ms/step - loss: 0.0797 - accuracy: 0.9942 - val_loss: 2.0273 - val_accuracy: 0.8683 Epoch 9/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0642 - accuracy: 0.9955 - val_loss: 2.5800 - val_accuracy: 0.8300 Epoch 10/100 78/78 [==============================] - 44s 561ms/step - loss: 0.1375 - accuracy: 0.9906 - val_loss: 2.5869 - val_accuracy: 0.8300 Epoch 11/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0568 - accuracy: 0.9965 - val_loss: 1.7245 - val_accuracy: 0.8800 Epoch 12/100 78/78 [==============================] - 44s 565ms/step - loss: 0.0894 - accuracy: 0.9941 - val_loss: 1.6055 - val_accuracy: 0.8917 Epoch 13/100 78/78 [==============================] - 44s 563ms/step - loss: 0.0535 - accuracy: 0.9961 - val_loss: 0.6531 - val_accuracy: 0.9550 Epoch 14/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0729 - accuracy: 0.9958 - val_loss: 0.7316 - val_accuracy: 0.9500 Epoch 15/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0207 - accuracy: 0.9987 - val_loss: 0.7039 - val_accuracy: 0.9500 Epoch 16/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0517 - accuracy: 0.9968 - val_loss: 1.7240 - val_accuracy: 0.8900 Epoch 17/100 78/78 [==============================] - 44s 563ms/step - loss: 0.0554 - accuracy: 0.9961 - val_loss: 0.5987 - val_accuracy: 0.9600 Epoch 18/100 78/78 [==============================] - 44s 563ms/step - loss: 0.0445 - accuracy: 0.9968 - val_loss: 1.1312 - val_accuracy: 0.9267 Epoch 19/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0499 - accuracy: 0.9968 - val_loss: 2.2075 - val_accuracy: 0.8567 Epoch 20/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0688 - accuracy: 0.9955 - val_loss: 0.2489 - val_accuracy: 0.9817 Epoch 21/100 78/78 [==============================] - 44s 564ms/step - loss: 0.0374 - accuracy: 0.9974 - val_loss: 1.4377 - val_accuracy: 0.9033 Epoch 22/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0171 - accuracy: 0.9987 - val_loss: 0.4843 - val_accuracy: 0.9683 Epoch 23/100 78/78 [==============================] - 44s 564ms/step - loss: 1.1929e-07 - accuracy: 1.0000 - val_loss: 0.4824 - val_accuracy: 0.9683 Epoch 24/100 78/78 [==============================] - 44s 561ms/step - loss: 2.0242e-07 - accuracy: 1.0000 - val_loss: 0.3737 - val_accuracy: 0.9700 Epoch 25/100 78/78 [==============================] - 44s 562ms/step - loss: 0.1602 - accuracy: 0.9900 - val_loss: 1.6354 - val_accuracy: 0.8900 Epoch 26/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0705 - accuracy: 0.9951 - val_loss: 1.5474 - val_accuracy: 0.8967 Epoch 27/100 78/78 [==============================] - 44s 570ms/step - loss: 0.0497 - accuracy: 0.9977 - val_loss: 0.2777 - val_accuracy: 0.9800 Epoch 28/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0052 - accuracy: 0.9997 - val_loss: 0.2793 - val_accuracy: 0.9800 Epoch 29/100 78/78 [==============================] - 45s 574ms/step - loss: 0.0145 - accuracy: 0.9987 - val_loss: 0.4313 - val_accuracy: 0.9667 Epoch 30/100 78/78 [==============================] - 43s 556ms/step - loss: 0.0155 - accuracy: 0.9990 - val_loss: 0.4313 - val_accuracy: 0.9667 Epoch 31/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0107 - accuracy: 0.9990 - val_loss: 0.3894 - val_accuracy: 0.9750 Epoch 32/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0227 - accuracy: 0.9984 - val_loss: 0.3501 - val_accuracy: 0.9750 Epoch 33/100 78/78 [==============================] - 44s 563ms/step - loss: 0.0155 - accuracy: 0.9990 - val_loss: 0.3501 - val_accuracy: 0.9750 Epoch 34/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0252 - accuracy: 0.9984 - val_loss: 1.5048 - val_accuracy: 0.9033 Epoch 35/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0200 - accuracy: 0.9984 - val_loss: 1.1886 - val_accuracy: 0.9217 Epoch 36/100 78/78 [==============================] - 44s 565ms/step - loss: 0.0272 - accuracy: 0.9981 - val_loss: 0.9491 - val_accuracy: 0.9383 Epoch 37/100 78/78 [==============================] - 45s 571ms/step - loss: 0.0052 - accuracy: 0.9997 - val_loss: 0.9491 - val_accuracy: 0.9383 Epoch 38/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0315 - accuracy: 0.9990 - val_loss: 0.2120 - val_accuracy: 0.9833 Epoch 39/100 78/78 [==============================] - 44s 568ms/step - loss: 0.0310 - accuracy: 0.9981 - val_loss: 0.2120 - val_accuracy: 0.9833 Epoch 40/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0182 - accuracy: 0.9987 - val_loss: 1.1718 - val_accuracy: 0.9250 Epoch 41/100 78/78 [==============================] - 44s 563ms/step - loss: 0.0332 - accuracy: 0.9977 - val_loss: 1.2215 - val_accuracy: 0.9183 Epoch 42/100 78/78 [==============================] - 43s 556ms/step - loss: 0.0313 - accuracy: 0.9977 - val_loss: 0.6424 - val_accuracy: 0.9550 Epoch 43/100 78/78 [==============================] - 44s 566ms/step - loss: 0.0103 - accuracy: 0.9994 - val_loss: 0.6399 - val_accuracy: 0.9583 Epoch 44/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0086 - accuracy: 0.9994 - val_loss: 1.7373 - val_accuracy: 0.8883 Epoch 45/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0146 - accuracy: 0.9990 - val_loss: 0.6929 - val_accuracy: 0.9517 Epoch 46/100 78/78 [==============================] - 44s 564ms/step - loss: 0.0155 - accuracy: 0.9990 - val_loss: 0.6929 - val_accuracy: 0.9517 Epoch 47/100 78/78 [==============================] - 44s 559ms/step - loss: 0.0155 - accuracy: 0.9990 - val_loss: 0.6929 - val_accuracy: 0.9517 Epoch 48/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0103 - accuracy: 0.9994 - val_loss: 0.6197 - val_accuracy: 0.9583 Epoch 49/100 78/78 [==============================] - 44s 569ms/step - loss: 0.0103 - accuracy: 0.9994 - val_loss: 0.6197 - val_accuracy: 0.9583 Epoch 50/100 78/78 [==============================] - 44s 562ms/step - loss: 0.0052 - accuracy: 0.9997 - val_loss: 0.6197 - val_accuracy: 0.9583 Epoch 51/100 78/78 [==============================] - 43s 556ms/step - loss: 0.0137 - accuracy: 0.9987 - val_loss: 0.6551 - val_accuracy: 0.9517 Epoch 52/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0103 - accuracy: 0.9994 - val_loss: 0.3270 - val_accuracy: 0.9750 Epoch 53/100 78/78 [==============================] - 44s 567ms/step - loss: 0.0129 - accuracy: 0.9990 - val_loss: 1.0809 - val_accuracy: 0.9283 Epoch 54/100 78/78 [==============================] - 44s 561ms/step - loss: 0.0103 - accuracy: 0.9994 - val_loss: 1.0809 - val_accuracy: 0.9283 Epoch 55/100 78/78 [==============================] - 43s 556ms/step - loss: 0.0052 - accuracy: 0.9997 - val_loss: 1.0809 - val_accuracy: 0.9283 Epoch 56/100 78/78 [==============================] - 46s 590ms/step - loss: 0.0104 - accuracy: 0.9994 - val_loss: 0.2965 - val_accuracy: 0.9817 Epoch 57/100 78/78 [==============================] - 45s 581ms/step - loss: 1.1921e-07 - accuracy: 1.0000 - val_loss: 0.2965 - val_accuracy: 0.9817 Epoch 58/100 77/78 [============================>.] - ETA: 0s - loss: 0.0106 - accuracy: 0.9990Restoring model weights from the end of the best epoch. 78/78 [==============================] - 45s 575ms/step - loss: 0.0104 - accuracy: 0.9990 - val_loss: 0.3009 - val_accuracy: 0.9800 Epoch 00058: early stopping Training done!
train_loss, train_acc = model2.evaluate_generator(train_generator)
val_loss, val_acc = model2.evaluate_generator(valid_generator)
test_loss, test_acc = model2.evaluate_generator(test_generator)
print('Train Accuracy: ', train_acc, '\nTrain Loss: ', train_loss, '\n' + 45*'_')
print('Validation Accuracy: ', val_acc, '\nValidation Loss: ', val_loss, '\n' + 45*'_')
print('Test Accuracy: ', test_acc, '\nTest Loss: ', test_loss)
Train Accuracy: 0.9837009 Train Loss: 0.21570764403269524 _____________________________________________ Validation Accuracy: 0.98373985 Validation Loss: 0.19876581951976569 _____________________________________________ Test Accuracy: 0.991404 Test Loss: 0.13431758681934033
In this section single predictions are done with the trained "MobileNetV2" network of images that are subjectively interpreted as "difficult", e.g. an image from me when wearing a facemask and images of my brother who is looking a lot like me.
from tensorflow.keras.preprocessing.image import load_img
from tensorflow.keras.preprocessing.image import img_to_array
def predict_on_image(filename):
"""function to make single prediction on an image """
# Load single image and convert to array
img = load_img(filename, target_size=IMAGE_SIZE)
img_plt = img_to_array(img)
# Reshape into a single image sample with 3 channels (tensor) and make type float32
img = img_plt.reshape(1, IMAGE_SIZE[0], IMAGE_SIZE[1], 3)
img = img.astype('float32')
# Preprocess image as what MobileNetV2 net needs for input
img = preprocess_input(img)
# Predict the class of the image and plot image
result = model2.predict(img)
plt.imshow(img_plt/255.0)
plt.title('Prediction: ' + labels[np.argmax(result[0])])
plt.show()
# Picture path of me and my brother that are quite challenging for the network
difficult_path = './Difficult_Images'
img_names = os.listdir(difficult_path) # List of image filenames
# Loop over all the difficult images and make predictions on them
for file in img_names:
if file.endswith('.JPG') or file.endswith('.jpg'): # Process jpg files only
predict_on_image(os.path.join(difficult_path, file)) # Function call
The neural network is challenged when it comes to predictions on images of my brother, who is looking a lot like me. As one can see above, the network sometimes predicts images of my brother as "Markus" and sometimes as "Others".
Images of my brother are not in the training dataset, so the network was not trained on images from him.
My brother is looking a lot more like me than most of the people in my training set despite the fact, that many young men are in the training dataset. I expected exactly this, that the network will have trouble to identify my brother correctly as "Others".
But the results are pretty good: There are 17 single images of my brother: 13 were correctly identified as "Others" (True Positive) and 4 were incorrectly identified as "Markus" (False Negative).
From 3 images of "Markus" waring a face mask, 2 were correctly predicted as "Markus" and 1 was incorrectly predicted as "Others". I expected the image where the mask is down on my chin and the whole face can be seen to be predicted correctly but this image was classified falsely as "Others"!
On the first try, training a neural network based on the "Xception" model was done and the results were not that satisfying with validation accuracy pending around 89%. Training the Xception model is not showed in this notebook. I tried a few more models and finally the "InceptionResNetV2"-model was the best for my task in terms of accuracy, precision and recall with values around 97-99% in all three metrics!
As it turned out, the decision of which model to use for transfer learning has major impact on the performance of the trained neural network.
The results of my neural network achieved with transfer learning based on the "InceptionResNetV2" model are very good and satisfying.
Accuracy, precision and recall are very good in both the validation and test dataset which I did not expect to be this good before first training and evaluating the model. The result was better than my expectations.
The performance of the "MobileNetV2" in terms of validation and test accuracy was even better!
Validation and Test Accuracy of the "InceptionResNetV2" are 98,5% and 98,6% and for the "MobileNetV2" they are 98,4% and 99,1%.
I did not expect the MobileNetV2 performing this good because it has way less layers and less mathematical operations than the InceptionResNetV2.
When high performance on accuracy, precision and recall is very important and of high priority, the InceptionResNetV2 is a very good choice for my facial recognition application. This model could be used when housedoors or doors in companies are opened based on a facial recognition application or in medical applications where False-Negatives can be fatal (For example: Prediction: No Melanoma, Ground-Truth: Melanoma).
When I want my application to be very reliable and trustworthy when it comes to predictions and classification, I would suggest to use the "InceptionResNetV2" as a basemodel for transfer learning. But the MobileNetV2 is performing similiar in terms of accuracy so both models will be a very good choice for this task.
But when computational power is limited, for example if we want to implement our application on an embedded system or on a mobile device, an efficient network model is needed which uses fewer mathematical operations and which is fast. In this case the MobileNetV2 network is the best choice and with only 14 MB model size it can be downloaded and implemented easily and fast on mobile devices or embedded systems.
When high priority is to have an fast and efficient model that comes with very few operational and resource needs I would suggest to use the "MobileNetv2" to use for transfer learning.
Both models are very good to implement my classification task.
Overfitting occured when there was an additional fully connected layer before the prediction layer in the InceptionresNetV2. The amount of trainable parameters was too high then and so the model learnt the training data by hard. The training accuracy was very high then but the validation accuracy was bad.
On the MobileNetV2 an additional fully connected layer was needed after the flattened output of the base_model and before the prediction layer in order to get the right capacity and not having underfitting.
To achieve even better performance when it comes to discerning my face from people looking a lot like me like my brother, there are several possibilities:
First, the training of the models was done on my home computer, which does not has a Nvidia GPU. Training was very slow and to train the whole notebook it would have needed more than 24 hours. So my Early-Stopping patience parameter was not a high value at first (4-6) so that training was around 14-16 hours.
After that I was able to train my notebook on a friend“s computer with a Nvidia GPU: a Nvidia GeForce GTX 1080 Ti. Training both models with an early-stopping patience of 20 was done in approximately 1 hour 45 minutes and parameters could be tuned and different settings could be tested.
So training on a Nvidia GPU is highly recommended for tasks like this.
The working on this project was very interesting and fun and I learned very much! I gained much interest in the world of machine learning and deep learning and I want to continue to focus on those topics in the future.